Connect to a MongoDB Realm Backend App - Kotlin SDK
On this page
The Realm app client is the interface to the MongoDB Realm backend. It provides access to the authentication, and Realm Sync.
Access the App Client
Pass the App ID for your Realm app, which you can find in the Realm UI.
val app = App.create(YOUR_APP_ID)
You can create multiple App
instances to connect to multiple
Realm apps or to the same Realm app with different configurations. All
App
instances that share the same App ID use the same underlying
connection.
Configuration
For more granular control of the details of your app connection,
such as custom timeouts for connections and keys for local encryption,
use the AppConfiguration.Builder to control details of your App
:
App.create( AppConfiguration.Builder(YOUR_APP_ID) .log(LogLevel.ALL) .build())
For most use cases, you only need your application's App ID to connect to MongoDB Realm. The other settings demonstrated here are optional.