Skip to main content

Setup

1

Get credentials

In your Vercel team, open Settings, then Apps, and click Create. Under Authorization Callback URLs, add your redirect URI, then generate a client secret and enable the openid, email and profile permissions:
2

Configure

lib/theauth.ts

Scopes

Default scopes: openid, email, profile Scopes the app does not have enabled in its dashboard settings are dropped by Vercel.

How it works

  • This uses the Sign in with Vercel authorization server: https://vercel.com/oauth/authorize, https://api.vercel.com/login/oauth/token and https://api.vercel.com/login/oauth/userinfo.
  • PKCE with S256 is required and always sent. Client credentials go in the form body.
  • The userinfo call is a POST with the access token as a Bearer header. It returns sub, email, email_verified, name, preferred_username and picture. The email counts as verified only when email_verified is true.
  • Add offline_access to scopes to receive a refresh token.
vercelProvider (the older preset) targets Vercel’s marketplace integration endpoints and cannot read the profile. It is still exported for existing code. Use createVercelProvider for new setups.
Vendor docs: Sign in with Vercel authorization server API.

Endpoints

Last modified on October 18, 2026