# Client configuration (/en/realtime-media/rtm/build/connect-and-authenticate/client-configuration/web)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Client configuration enables you to customize the behavior of your Signaling client instance according to your app's requirements.

    ## Understand the tech [#understand-the-tech]

    When initializing a Signaling client instance, configure any or all of the following features:

    * **Geographical area access**
      When a user joins a channel, Signaling SDK automatically connects them to the closest geographical region of Agora SDRTN®. However, to comply with local laws and regulations, you may want to specify or restrict connections to a specific geographical area. Agora enables you to control and customize data routing in your app by specifying the Agora SDRTN® region users connect to.

    * **Enable proxy connection**
      You use a proxy connection to ensure reliable connectivity for your users when they connect from an environment with a restricted network. This helps in maintaining a stable connection even in environments with network restrictions.

    * **Private deployment**
      Private deployment enables you to deploy and manage the Signaling environment on your own infrastructure rather than using Agora services. This feature is fully supported since version 2.2.0.

    * **Logging**
      Logging enables you to output detailed information from the SDK for locating and fixing problems during the development and testing phases. By configuring logging settings, you can control the amount and type of information logged by the SDK.

    * **Data encryption**
      Enabling encryption ensures that only authorized users are able to read messages sent through Signaling. Signaling provides built-in encryption methods that guarantee data confidentiality during transmission. For implementation details, see [Data encryption](../secure-your-app-and-data/data-encryption).

    ## Prerequisites [#prerequisites]

    Ensure that you have integrated the Signaling SDK in your project and implemented the framework functionality from the [SDK quickstart](../../index) page.

    ## Configure the client instance [#configure-the-client-instance]

    This section explains how to set up and customize various features when you initialize a Signaling client instance.

    ### Geographical area configuration [#geographical-area-configuration]

    To specify a geographical area for Agora SDRTN® connections, refer to the following code:

    ```js
    // Set whitelist and blacklist areas
    AgoraRTM.setArea({ areaCodes: ["GLOBAL"], excludedArea: "CHINA" })
    ```

    ### Proxy configuration [#proxy-configuration]

    In some environments with restricted network services, you may need to set up a proxy service to access external resources. Signaling supports configuring a proxy service. You enable this feature during the Signaling instance initialization.

    ```javascript
    const { RTM } = AgoraRTM;
    const appId = "your_appId";
    const userId = "your_userId";
    const rtmConfig = { cloudProxy: true };
    const rtm = new RTM(appId, userId, rtmConfig);
    ```

    <CalloutContainer type="info">
      <CalloutDescription>
        This feature is only available for Message channels and User channels.
      </CalloutDescription>
    </CalloutContainer>

    ### Private deployment configuration [#private-deployment-configuration]

    Agora is committed to offering its customers flexible, secure, and customizable solutions. Since version `2.2.0`, Signaling supports private deployments. This feature enables you to deploy and manage the Signaling environment yourself, giving you more control over your data and systems.

    Signaling provides `MESSAGE` and `STREAM` services. Choose one or both services based on your needs and budget. The following code shows you how to configure a private environment that deploys both services simultaneously:

    ```js
    const appId = "your_appId";
    const userId = "your_userId";
    const rtmConfig = {
        privateConfig: {
            serviceType: ["MESSAGE", "STREAM"], // Service type for private deployment
            accessPointHosts: ["private.mynet.com"], // Private deployment server list, only domain name is supported
            domainMode: 2,
        }
    };
    const rtm = new RTM(appId, userId, rtmConfig);
    ```

    <CalloutContainer type="warning">
      <CalloutTitle>
        Note
      </CalloutTitle>

      <CalloutDescription>
        To upgrade the privately deployed Signaling Web SDK to v2.2.4 or later, set `domainMode` to `2` for compatibility. If you omit this parameter or use the default value `1`, the SDK may fail to connect to the Signaling server.
      </CalloutDescription>
    </CalloutContainer>

    <CalloutContainer type="info">
      <CalloutDescription>
        To deploy a private environment, you need to set up the backend service. For assistance, please contact [technical support](mailto\:support@agora.io).
      </CalloutDescription>
    </CalloutContainer>

    ### Log configuration [#log-configuration]

    In the development and testing phase of your app, you may need to output more detailed information to locate and fix problems. Enable log output of the SDK and set the log information level by configuring `logLevel` when initializing the Signaling client instance. You can view the log information in the browser console.

    ```javascript
    const { RTM } = AgoraRTM;
    const appId = "your_appId";
    const userId = "your_userId";
    const rtmConfig = { logLevel : "debug" };
    const rtm = new RTM(appId, userId, rtmConfig);
    ```

    Choose the log level from the following:

    | Enumeration Value | Description                                       |
    | ----------------- | ------------------------------------------------- |
    | `debug`           | Output all logs.                                  |
    | `info`            | Output logs of level `error`, `warn`, and `info`. |
    | `warn`            | Output logs of level `error`, and `warn`.         |
    | `error`           | Output logs of level `error`.                     |
    | `none`            | No log output.                                    |

    <CalloutContainer type="info">
      <CalloutDescription>
        When your app is released to production, set the log level to `info`.
      </CalloutDescription>
    </CalloutContainer>

    ## Reference [#reference]

    This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.

    For firewall configuration, see [firewall requirements](../../reference/firewall)

    
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
      
  
