matrix-js-sdk
    Preparing search index...

    Interface IHttpOpts

    Options object for FetchHttpApi and MatrixHttpApi.

    interface IHttpOpts {
        accessToken?: string;
        authMetadataCallback?: () => Promise<ValidatedAuthMetadata>;
        baseUrl: string;
        extraParams?: QueryDict;
        fetchFn?: {
            (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
            (input: string | Request | URL, init?: RequestInit): Promise<Response>;
        };
        idBaseUrl?: string;
        localTimeoutMs?: number;
        logger?: Logger;
        oauth2ClientConfig?: OAuth2ClientConfig;
        onlyData?: boolean;
        onTokenRefresh?: TokenRefreshCallback;
        prefix: string;
        refreshToken?: string;
        useAuthorizationHeader?: boolean;
    }
    Index
    accessToken?: string
    authMetadataCallback?: () => Promise<ValidatedAuthMetadata>

    Discovers and validates the delegated auth server's metadata for the current homeserver. Must be supplied along with oauth2ClientConfig in order to refresh tokens.

    Type Declaration

    when delegated auth config is invalid or unreachable

    baseUrl: string
    extraParams?: QueryDict
    fetchFn?: {
        (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
        (input: string | Request | URL, init?: RequestInit): Promise<Response>;
    }

    Type Declaration

    idBaseUrl?: string
    localTimeoutMs?: number
    logger?: Logger

    Optional logger instance. If provided, requests and responses will be logged.

    oauth2ClientConfig?: OAuth2ClientConfig

    Configuration needed to refresh (given refreshToken) and revoke (e.g. on logout) tokens for an OAuth2-native session. Optional; if omitted, tokens will not be refreshed or revoked by the SDK. authMetadataCallback must also be supplied to refresh tokens.

    onlyData?: boolean

    For historical reasons, must be set to true. Will eventually be removed.

    onTokenRefresh?: TokenRefreshCallback

    Callback called when tokens are refreshed. Must be supplied if refreshToken is supplied.

    prefix: string
    refreshToken?: string

    Used in conjunction with oauth2ClientConfig to attempt token refresh

    useAuthorizationHeader?: boolean

    Whether to use the HTTP Authorization header over the access_token query parameter