Docs Menu

Docs HomeDevelop ApplicationsAtlas Device SDKs

Connect to an Atlas App Services Backend - .NET SDK

On this page

  • Access the App Client
  • Configuration

The App client is the interface to the App Services backend. It provides access to the authentication functionality, functions, and sync management.

Pass the App ID for your App, which you can find in the Realm UI.

var myRealmAppId = "<your_app_id>";
var app = App.Create(myRealmAppId);

For most use cases, you only need your application's App ID to connect to App Services. For granular control of your app connection, such as custom timeouts for connections and the log level, you can optionally pass an AppConfiguration object to the App.Create() method. The following example sets the LogLevel and the request timeout:

var appConfig = new AppConfiguration(myRealmAppId)
{
DefaultRequestTimeout = TimeSpan.FromMilliseconds(1500)
};
app = App.Create(appConfig);

You can create multiple App client instances to connect to multiple Apps. All App client instances that share the same App ID use the same underlying connection.

Important

Changing an App Config After Initializing the App

Changed in version v11.7.0: BaseUri is not cached in the App configuration

When you initialize the App client, the configuration is cached internally. Attempting to close and then re-open an App with a changed configuration within the same process has no effect. The client continues to use the cached configuration.

In .NET SDK version 11.7.0 and later, the BaseUri is no longer cached in the App configuration. This means that you can change the BaseUri, and the App client will use the updated configuration. In earlier SDK versions, changes to the BaseUri in a cached App configuration have no effect.

← Application Services - .NET SDK