Docs Menu

Connect to a MongoDB Realm Backend App - Flutter SDK

On this page

  • Before You Begin
  • Access the App Client
  • Advanced Configuration

The App client is the interface to the Atlas App Services backend. It provides access to the authentication and Atlas Device Sync.

  1. Create an Atlas App Services app
  1. Find the App ID in the Realm UI.
  2. Create an AppConfiguration object with your App's App ID as the argument.
  3. Create an App with the AppConfiguration you just created. You use this App instance to access Atlas App Services features throughout your client application.
AppConfiguration appConfig = AppConfiguration(APP_ID);
App app = App(appConfig);

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.

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

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.

←  Application Services Overview - Flutter SDKUsers - Flutter SDK →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.