Initialize the App Client - Web SDK
Atlas Device SDKs are deprecated. Refer to the deprecation page for details.
Overview
The App client is the interface to the Atlas App Services backend. It provides access to the authentication functionality and functions.
Access the App Client
Pass the App Services App ID for your App, which you can find in the App Services UI.
const id = APP_ID; // replace this with your App ID
Configuration
To set up your App client, pass a configuration object to an instance
of Realm.App
.
const config = { id, }; const app = new Realm.App(config);
Note
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.
Retrieve an Instance of the App Client
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(APP_ID); // replace this with your App ID