Class App<FunctionsFactoryType, CustomDataType>

The class represents an Atlas App Services Application.

const app = new App({ id: "my-app-qwert" });

Type Parameters

Constructors

Properties

listeners: any
appById: any
appByUserId: any

Accessors

  • get emailPasswordAuth(): EmailPasswordAuth
  • Perform operations related to the email/password auth provider.

    Returns EmailPasswordAuth

    An instance of the email password authentication provider.

  • get id(): string
  • Returns string

    The app ID.

Methods

  • Adds a listener that will be fired on various user events. This includes login, logout, switching users, linking users and refreshing custom data.

    Parameters

    • callback: AppChangeCallback

      A callback function that will be called when the event occurs.

    Returns void

  • Delete the user. NOTE: This irrecoverably deletes the user from the device as well as the server!

    Parameters

    Returns Promise<void>

    A promise that resolves once the user has been deleted.

  • Removes all event listeners previously added via App.addListener.

    Returns void

  • Removes an event listener previously added via App.addListener.

    Parameters

    Returns void

  • Logs out and removes a user from the client.

    Parameters

    Returns Promise<void>

    A promise that resolves once the user has been logged out and removed from the app.

  • Switches the current user to the one specified in user.

    Parameters

    • user: AnyUser

      The user to switch to.

    Returns void

    Throws

    an Error if the new user is logged out or removed.

  • Get or create a singleton Realm App from an ID. Calling this function multiple times with the same ID will return the same instance.

    Parameters

    • id: string

      The Realm App ID visible from the Atlas App Services UI or a configuration.

    Returns App<DefaultFunctionsFactory, DefaultObject>

    The Realm App instance.

  • Get or create a singleton Realm App from an ID. Calling this function multiple times with the same ID will return the same instance.

    Parameters

    • id: string

      The Realm App ID visible from the Atlas App Services UI or a configuration.

    Returns App<DefaultFunctionsFactory, DefaultObject>

    The Realm App instance.

    Deprecated

    Use App.get.

Generated using TypeDoc