Config: {
    PromiseLib?: PromiseLibType | null;
    baseUrl: string;
    customConfig?: Record<string, string>;
    initializationTimeout?: number;
    language?: string | null;
    onTokenRequired: OnTokenRequired;
}

Type declaration

  • Optional PromiseLib?: PromiseLibType | null

    Promise implementation to be used. Defaults to native promises, which requires a polyfill to work in any Internet Explorer.

    Can be replaced with another implementation, such as Q or Bluebird.

    null disables promises returned from functions.

  • baseUrl: string

    URL pointing to root of embedded application, e.g. if template is at https://www.bar.foo/template, then baseUrl should be https://www.bar.foo.

  • Optional customConfig?: Record<string, string>

    Custom named values (such as customizable colors) sent to the views.

  • Optional initializationTimeout?: number

    Timeout from when view is created, and all scripts are loaded. If the view is not responsive before this, onError is invoked with a load error.

    Value is in milliseconds.

    Default is 10000 milliseconds.

  • Optional language?: string | null

    Language to be used by all bridge views as a BCP-47 string.

  • onTokenRequired: OnTokenRequired

    Callback invoked whenever BridgeViews need an authentication token.

    Takes the current language-tag as first parameter. Can either return a promise or invoke a node-style callback provided as second parameter to signal completion.

    Three cases are supported:

    • Success: Should resolve to the new token string.
    • Unauthenticated: User is not logged in. Should resolve to null.
    • Unavailable: User is still logged in, but a new token can't be retrived for some reason, e.g. lost connection. Should reject with any error

    Param

    The current language tag, provided for convenience.

    Param

    node-style callback – (error, result) => void

Generated using TypeDoc