agentic-openapi-parser
    Preparing search index...

    Interface Oauth2RefreshTokenRefresherOptions

    interface Oauth2RefreshTokenRefresherOptions {
        defaultExpiresInSecs?: number;
        logger?: ILogger;
        onRefreshed?: (newState: OAuth2TokenState) => void | Promise<void>;
        refreshThresholdMs?: number;
        requestFormat?: OAuth2RefreshRequestFormat;
        responseAccessTokenPath?: string;
        responseExpiresInPath?: string;
        responseRefreshTokenPath?: string;
    }
    Index
    defaultExpiresInSecs?: number

    Used only when no expiry field can be found anywhere in the response — many internal auth endpoints don't return a TTL at all. Defaults to 3600 (1 hour).

    logger?: ILogger
    onRefreshed?: (newState: OAuth2TokenState) => void | Promise<void>

    Fire-and-forget hook for persisting the refreshed token (e.g. to a DB via a queue job).

    refreshThresholdMs?: number

    How far ahead of expiry to trigger a refresh, in ms. Defaults to 5 minutes.

    Most OAuth2 token endpoints (Google, Microsoft, HubSpot, Salesforce, Spotify...) accept application/x-www-form-urlencoded, which is the default. A few (e.g. Atlassian's auth.atlassian.com) require a JSON body instead.

    responseAccessTokenPath?: string

    Manual dot-path overrides for non-standard response shapes (e.g. "data.token.accessToken"). Only needed when the built-in auto-detection (snake_case, camelCase, and a 1-level "data"/ "result" envelope) can't find the field — most hand-rolled internal auth endpoints don't need these. When given, the override fully replaces auto-detection for that field (no fallback).

    responseExpiresInPath?: string
    responseRefreshTokenPath?: string