@shortcut/client
    Preparing search index...

    Interface ShortcutV4RefreshOptions

    When and how the client rotates its bearer token.

    interface ShortcutV4RefreshOptions {
        beforeMs?: number;
        expiresAt?: string | number | Date;
        run: () => Promise<ShortcutV4RefreshedToken>;
    }
    Index

    Properties

    beforeMs?: number

    How long before expiresAt to refresh. Defaults to five minutes.

    expiresAt?: string | number | Date

    When the current token expires; enables proactive refresh.

    run: () => Promise<ShortcutV4RefreshedToken>

    Rotates the token, persisting whatever the caller needs, and returns the new one. Called before a request once expiresAt is within beforeMs, and after a 401. Concurrent requests share one call.