Skip to content

Spotify

Spotify OAuth2 with PKCE (S256). No id token.

Configure

python
from better_auth import BetterAuth
from better_auth.oauth.providers_ext import Spotify

auth = BetterAuth(
    secret=...,
    social_providers={
        "spotify": Spotify(client_id="", client_secret=""),
    },
)

Or name-keyed (no import):

python
auth = BetterAuth(
    secret=...,
    social_providers={
        "spotify": {"client_id": "", "client_secret": ""},
    },
)

Options

FieldTypeDefaultNotes
client_idstr | list[str]required
client_secretstrrequired

All shared ProviderConfig options apply.

Notes

  • Default scopes: user-read-email.
  • Register {base_url}{base_path}/callback/spotify as the redirect URI in the Spotify developer dashboard.
  • Avatar: Spotify's images is a size-ordered array — the first entry's url is used, None when empty.
  • email_verified is always False — Spotify's userinfo has no such claim.

MIT licensed · API-compatible with better-auth