Vairified TypeScript SDK - v0.3.1
    Preparing search index...

    Class OAuthResource

    OAuth 2.0 flow for obtaining player consent.

    Typical flow:

    1. authorize — start an authorization, get a URL to redirect the player to.
    2. Player approves on the Vairified site and is redirected back to your redirectUri with a code query parameter.
    3. exchangeToken — swap the code for access and refresh tokens plus the player's external ID.
    4. Store the refresh token and call refresh when the access token expires.
    5. revoke — disconnect a player from your app.
    Index

    Methods

    • Exchange an authorization code for access and refresh tokens.

      Parameters

      • options: { code: string; redirectUri: string }

      Returns Promise<TokenResponse>

    • Revoke a player's OAuth connection to your app.

      Parameters

      • playerId: string

      Returns Promise<Record<string, unknown>>

    • Return the list of OAuth scopes the server currently supports.

      Returns Promise<readonly { name: string; description: string }[]>