Docs Menu

Initialize the Realm App Clienticons/link.png

The Realm app client is the interface to the MongoDB Realm backend. It provides access to the authentication functionality and functions.

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

const id = "<Your App ID>"; // replace this with your App ID

To set up your Realm app client, pass a configuration object to an instance of Realm.App.

const config = {
const app = new Realm.App(config);

id is a required field of the application configuration object. To see the full list of fields for the configuration object that Realm.App accepts as a parameter, view the App Configuration Type Definitions.

To retrieve an instance of the App Client from anywhere in your application, call Realm.App.getApp() and pass in your App ID.

const app = Realm.App.getApp("<Your App ID>"); // replace this with your App ID
Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.


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