Type alias BazaarOptions

BazaarOptions: {
    appId: string;
    bazaarUri?: string;
    loginRedirectUri: string;
    onApiConnect?: ((bzr) => Promise<void>);
    onApiConnectError?: ((bzr, message) => Promise<void>);
    onLogin?: ((bzr) => Promise<void>);
    onLoginError?: ((bzr, message) => Promise<void>);
}

Options for initializing a BazaarApp instance

Type declaration

  • appId: string
  • Optional bazaarUri?: string

    Public URI for the API & OAuth server.

  • loginRedirectUri: string

    The URI the auth server redirects to with an auth code after login request approval.

  • Optional onApiConnect?: ((bzr) => Promise<void>)

    Provide a callback to handle API connections. Will be called after login and any subsequent re-connection.

      • (bzr): Promise<void>
      • Parameters

        Returns Promise<void>

  • Optional onApiConnectError?: ((bzr, message) => Promise<void>)

    Provide a callback to handle failed data API connections. E.g. unauthorized, or expired token.

      • (bzr, message): Promise<void>
      • Parameters

        Returns Promise<void>

  • Optional onLogin?: ((bzr) => Promise<void>)

    Provide a callback to handle a successful login.

    e.g. Set state, redirect, etc.

      • (bzr): Promise<void>
      • Parameters

        Returns Promise<void>

  • Optional onLoginError?: ((bzr, message) => Promise<void>)

    Provide a callback to handle a failed login. E.g. invalid authorization code.

    e.g. Set state, redirect, etc.

      • (bzr, message): Promise<void>
      • Parameters

        Returns Promise<void>