SpotifyAdapter

new SpotifyAdapter(options)

Parse Server Configuration

To configure Parse Server for Spotify authentication, use the following structure:

Secure Configuration

{
  "auth": {
    "spotify": {
      "clientId": "your-client-id"
    }
  }
}

Insecure Configuration (Not Recommended)

{
  "auth": {
    "spotify": {
      "enableInsecureAuth": true
    }
  }
}

The adapter requires the following authData fields:

  • Secure Authentication: code, redirect_uri, and code_verifier.
  • Insecure Authentication (Not Recommended): id, access_token.

Auth Payloads

Secure Authentication Payload

{
  "spotify": {
    "code": "abc123def456ghi789",
    "redirect_uri": "https://example.com/callback",
    "code_verifier": "secure-code-verifier"
  }
}

Insecure Authentication Payload (Not Recommended)

{
  "spotify": {
    "id": "1234567",
    "access_token": "abc123def456ghi789"
  }
}

Notes

  • enableInsecureAuth is not recommended and bypasses secure flows by validating the user ID and access token directly. This method is not suitable for production environments and may be removed in future versions.
  • Secure authentication exchanges the code provided by the client for an access token using Spotify's OAuth API. This method ensures greater security and is the recommended approach.
Parameters:
NameTypeDescription
optionsObject

The adapter configuration options.

Properties
NameTypeAttributesDefaultDescription
clientIdstring

Your Spotify application's Client ID. Required for secure authentication.

enableInsecureAuthboolean<optional>
false

[DEPRECATED] Enable insecure authentication (not recommended).