Connect to a MongoDB Realm Backend App - Flutter SDK
The App client is the interface to the Atlas App Services backend. It provides access to the authentication and Atlas Device Sync.
Before You Begin
Access the App Client
- Find the App ID in the Realm UI.
- Create an AppConfiguration object with your App's App ID as the argument.
- Create an App
with the
AppConfiguration
you just created. You use thisApp
instance to access Atlas App Services features throughout your client application.
AppConfiguration appConfig = AppConfiguration(APP_ID); App app = App(appConfig);
Note
You can create multiple App
instances to connect to multiple
Apps or to the same App with different configurations. All
App
instances that share the same App ID use the same underlying
connection.
Advanced Configuration
Add additional configuration for more granular control of the details of your app client, such as custom timeouts for connections and keys for local encryption. You can add optional arguments to the AppConfiguration:
AppConfiguration appConfig = AppConfiguration(APP_ID, defaultRequestTimeout: const Duration(seconds: 120), localAppVersion: '2.0' // ... see reference docs for all available configuration options );
Note
For most use cases, you only need your application's App ID to connect to Atlas App Services. The other settings demonstrated here are optional.