Multi-region Support

Last Edit: Nov 27 2020

Stream's Chat infrastructure is partially replicated on several regions, allowing developers all around the globe to optimize for network latency by mapping their usage to the region closest to their users. There is support for Chat in US East, EU West, Singapore and Sydney.

Users can now arbitrarily create apps in the location of their choice, without any action or approval needed from our side. Two steps are required to do so :

Dashboard Server Location

For Chat, users will first choose hosting their app in our US East, EU West or Singapore server instances.

Client Location Settings

In order to ensure region matching between your dashboard app configuration and your API client (meaning for your API client to send request to the server location you've selected), you will need to manually set the base URL with your location like the following :


//Set the client server location to EU West region
client.setBaseURL('https://chat-proxy-dublin.stream-io-api.com');

//Set the client server location to US-East region
client.setBaseURL('https://chat-proxy-us-east.stream-io-api.com');

//Set the client server location to Singapore region
client.setBaseURL('https://chat-proxy-singapore.stream-io-api.com');

//Set the client server location to Sydney region
client.setBaseURL('https://chat-proxy-sydney.stream-io-api.com');
                    

// You can set a predetermined baseURL that Stream offers
Client.configureShared(.init(apiKey: YOUR_API_KEY, baseURL: .dublin))
// or
Client.configureShared(.init(apiKey: YOUR_API_KEY, baseURL: .usEast))
// or, you can just use a string
Client.configureShared(.init(apiKey: YOUR_API_KEY, baseURL: "https://chat-proxy-singapore.stream-io-api.com/")!)
// or
Client.configureShared(.init(apiKey: YOUR_API_KEY, baseURL: "https://chat-proxy-sydney.stream-io-api.com/")!)
                    

// EU West - Dublin region
val client = ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-dublin.stream-io-api.com/")
    .build()

// US East region    
val client = ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-us-east.stream-io-api.com/")
    .build()
    
// Singapore region 
val client = ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-singapore.stream-io-api.com/")
    .build()

// Sydney region       
val client = ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-sydney.stream-io-api.com/")
    .build()
                    

// EU West - Dublin region
ChatClient client = new ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-dublin.stream-io-api.com/")
    .build();

// US East region    
ChatClient client = new ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-us-east.stream-io-api.com/")
    .build();

// Singapore region    
ChatClient client = new ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-singapore.stream-io-api.com/")
    .build();

// Sydney region    
ChatClient client = new ChatClient.Builder(apiKey, context)
    .baseUrl("https://chat-proxy-sydney.stream-io-api.com/")
    .build();
                    

// EU West - Dublin region
  final client = Client(
    apiKey,
    baseUrl: 'https://chat-proxy-dublin.stream-io-api.com/',
  );

// US East region  
  final client = Client(
    apiKey,
    baseUrl: 'https://chat-proxy-us-east.stream-io-api.com/',
  );

// Singapore region  
  final client = Client(
    apiKey,
    baseUrl: 'https://chat-proxy-singapore.stream-io-api.com/',
  );
  
// Sydney region
  final client = Client(
    apiKey,
    baseUrl: 'https://chat-proxy-sydney.stream-io-api.com/',
  );
                    

// possible locations
$client->setLocation("us-east");
$client->setLocation("dublin");
$client->setLocation("sidney");
$client->setLocation("tokyo");