Options
All
  • Public
  • Public/Protected
  • All
Menu

Cordova Spotify OAuth Plugin

Index

Interfaces

Variables

Functions

Variables

LOCAL_STORAGE_KEY

LOCAL_STORAGE_KEY: "SpotifyOAuthData" = "SpotifyOAuthData"

The local storage key where the auth data is cached.

The data is stored as stringified JSON object.

Functions

authorize

  • Obtains valid authorization data.

    This method performs the necessary steps in order to obtain a valid access token. It performs the OAuth dance prompting the user to log in, exchanges the obtained authorization code for an access and a refresh token, caches those, and returns both to the developer.

    When it is invoked again, it will first check whether the cached access token is still valid (including a configurable safety margin) and the scopes equal, and return the token directly if that is the case. Otherwise, the method will transparently refresh the token (or obtain a new one if the scopes changed) and return that.

    Bottom line - always call this if you need a valid access token in your code.

    Parameters

    • cfg: Config

      OAuth configuration

    Returns Promise<AuthorizationData>

forget

  • forget(): void
  • Removes all cached data so that authorize performs the full oauth dance again.

    This is akin to a "logout".

    Returns void

Generated using TypeDoc