Firemitt - v0.1.9
    Preparing search index...

    Class FiremittHelper

    Helper class for handling authentication processes using Firemitt.

    Provides static methods to initiate authentication via a popup window or an embedded iframe. Uses ConfigHelper to initialize and validate configuration, and runs a cross-window handshake with the Fireguard auth page for each session.

    Index
    • Initiates authentication using Firemitt options.

      Depending on the mode field in options, this either opens a popup window (default) or embeds Fireguard inside an iframe. In popup mode, it must be called synchronously from a user gesture (e.g. a click handler), otherwise the browser blocks the popup.

      Starting a new session cancels the previous one, which then rejects with "A new authentication session was started.".

      Parameters

      • options: {
            config?: {
                firebase?: {
                    apiKey: string;
                    appId: string;
                    authDomain: string;
                    measurementId?: string;
                    messagingSenderId?: string;
                    projectId: string;
                    storageBucket?: string;
                };
                logo?: string;
                name?: string;
                provider?: string;
                theme?: {
                    background?: string;
                    primary?: string;
                    secondary?: string;
                    text?: string;
                };
            };
            dim?: { height?: number; width?: number };
            iframe?:
                | { container?: undefined; element: HTMLIFrameElement }
                | { container: HTMLElement; element?: undefined };
            mode?: "popup" | "iframe";
            pos?: { x?: number; y?: number };
            url: string;
        }

        The options required to configure and initiate the Firemitt authentication process.

      Returns Promise<string>

      A promise that resolves with the authentication token on success, or rejects with an error on failure (PopupBlockedError, AuthFailedError, or an Error when the window is closed or the session is replaced).

      Synchronously, if the options are invalid.