@health-samurai/aidbox-client
    Preparing search index...

    Type Alias SmartAppLaunchAuthProviderConfig<TUser>

    Configuration for SmartAppLaunchAuthProvider.

    The provider holds no session state of its own — it asks the host for the current session on every request via getSession, and reports refreshed sessions back via setSession. This makes the host's session store the single source of truth and avoids cache-coherence bugs across multiple provider instances or processes.

    type SmartAppLaunchAuthProviderConfig<TUser = UserInfo> = {
        baseUrl: string;
        getSession: () => SmartSession<TUser> | Promise<SmartSession<TUser>>;
        setSession: (session: SmartSession<TUser>) => void | Promise<void>;
        getClientSecret?: (
            session: SmartSession<TUser>,
        ) => string | undefined | Promise<string | undefined>;
        tokenExpirationBuffer?: number;
    }

    Type Parameters

    Index

    Properties

    baseUrl: string

    FHIR server base URL — used for validateBaseUrl and exposed as provider.baseUrl.

    getSession: () => SmartSession<TUser> | Promise<SmartSession<TUser>>

    Called on every request to retrieve the current session.

    setSession: (session: SmartSession<TUser>) => void | Promise<void>

    Called whenever the provider obtains a new session (after refresh). The host must persist it.

    getClientSecret?: (
        session: SmartSession<TUser>,
    ) => string | undefined | Promise<string | undefined>

    Resolves the confidential client secret server-side. Required when sessions use usesClientSecret.

    tokenExpirationBuffer?: number

    Refresh the token this many seconds before expiry (default: 30).