Vana SDK - v3.5.0
    Preparing search index...

    Interface OAuthClientConfig

    Constructor options for OAuthClient.

    interface OAuthClientConfig {
        authorizationEndpoint: string;
        tokenEndpoint: string;
        clientId: string;
        redirectUri: string;
        scope?: string;
        tokenStore?: TokenStore;
        fetchImpl?: {
            (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
            (input: string | Request | URL, init?: RequestInit): Promise<Response>;
        };
        generateState?: () => string;
    }
    Index

    Properties

    authorizationEndpoint: string

    Authorization endpoint, e.g. https://account.vana.org/oauth/authorize.

    tokenEndpoint: string

    Token endpoint, e.g. https://account.vana.org/oauth/token.

    clientId: string

    OAuth client_id (public; PKCE protects the flow).

    redirectUri: string

    Redirect URI registered with the authorization server.

    scope?: string

    Default scope; can be overridden per call.

    tokenStore?: TokenStore

    Where to persist access + refresh tokens and the in-flight code verifier between authorizecallback. Defaults to a fresh InMemoryTokenStore. Use IndexedDB/localStorage-backed implementations for browser apps where the user navigates away during the dance.

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

    Override the global fetch (e.g. for tests). Defaults to globalThis.fetch.

    Type Declaration

      • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
      • Parameters

        • input: RequestInfo | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | Request | URL, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | Request | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

    generateState?: () => string

    Override the random-state generator (mostly for tests). Must return a URL-safe string of >= 16 bytes of entropy.