[PR #6316] [MERGED] feat: Add Vercel as OAuth provider #14834

Closed
opened 2026-04-13 09:39:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6316
Author: @anatrajkovska
Created: 11/25/2025
Status: Merged
Merged: 11/26/2025
Merged by: @Bekacru

Base: canaryHead: feat/add-sign-in-with-vercel


📝 Commits (4)

📊 Changes

11 files changed (+626 additions, -5 deletions)

View changed files

📝 demo/nextjs/.env.example (+2 -1)
📝 demo/nextjs/components/sign-in.tsx (+22 -0)
📝 demo/nextjs/lib/auth.ts (+4 -0)
📝 demo/nextjs/turbo.json (+3 -1)
📝 docs/components/builder/social-provider.tsx (+15 -0)
📝 docs/components/sidebar-content.tsx (+16 -0)
docs/content/docs/authentication/vercel.mdx (+89 -0)
📝 packages/better-auth/src/social.test.ts (+381 -1)
📝 packages/core/src/oauth2/create-authorization-url.ts (+4 -2)
📝 packages/core/src/social-providers/index.ts (+3 -0)
packages/core/src/social-providers/vercel.ts (+87 -0)

📄 Description

This PR adds Vercel as additional OAuth provider, enabling users to authenticate with their Vercel accounts.

Changes

  • Vercel can be configured as OAuth provider for login
  • PKCE is supported as it's required by Vercel
  • Configurable scopes: openid, email, profile, offline_access
  • Added docs to guide developers on how to set it up
  • Added to the "Create Sign in Box" configuration builder
  • Added tests
  • Extended the built-in demo app to include "Sign in with Vercel"

Demo

https://github.com/user-attachments/assets/145d68f9-7f4d-489b-8e0e-f2bb358f6bab


Summary by cubic

Added Vercel as an OAuth provider with required PKCE, so users can sign in with their Vercel accounts. Updated the demo, docs, and the configuration builder to make setup easy.

  • New Features

    • New Vercel provider (id: vercel) with PKCE and userinfo mapping.
    • Supports scopes: openid, email, profile, offline_access; passing scopes is optional.
    • mapProfileToUser supported for custom user fields.
    • Demo includes “Sign in with Vercel”; builder shows provider with icon.
    • Tests cover PKCE, scopes, callbacks, and existing-user flows.
  • Migration

    • Create a Vercel App and set redirect URL: /api/auth/callback/vercel.
    • Add env vars: VERCEL_APP_CLIENT_ID, VERCEL_APP_CLIENT_SECRET.
    • Configure socialProviders.vercel in auth.ts.
    • If you use createAuthorizationURL directly, scopes are now optional.

Written for commit ab6cf973a1. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6316 **Author:** [@anatrajkovska](https://github.com/anatrajkovska) **Created:** 11/25/2025 **Status:** ✅ Merged **Merged:** 11/26/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/add-sign-in-with-vercel` --- ### 📝 Commits (4) - [`16ac132`](https://github.com/better-auth/better-auth/commit/16ac132fffb9cb5a19ecc3880080855a17b8abf7) feat: Add Vercel as OAuth provider - [`f7c5430`](https://github.com/better-auth/better-auth/commit/f7c54303ed98e60fc554e4e712f41fd0a2722eb6) fix: Check for codeVerifier - [`c685e92`](https://github.com/better-auth/better-auth/commit/c685e92112c8ac147b91629141aea423a47d9f5a) fix: Update tests - [`ab6cf97`](https://github.com/better-auth/better-auth/commit/ab6cf973a11f3fca3e04db35ba339dc36cbdd581) fix: Import order ### 📊 Changes **11 files changed** (+626 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/.env.example` (+2 -1) 📝 `demo/nextjs/components/sign-in.tsx` (+22 -0) 📝 `demo/nextjs/lib/auth.ts` (+4 -0) 📝 `demo/nextjs/turbo.json` (+3 -1) 📝 `docs/components/builder/social-provider.tsx` (+15 -0) 📝 `docs/components/sidebar-content.tsx` (+16 -0) ➕ `docs/content/docs/authentication/vercel.mdx` (+89 -0) 📝 `packages/better-auth/src/social.test.ts` (+381 -1) 📝 `packages/core/src/oauth2/create-authorization-url.ts` (+4 -2) 📝 `packages/core/src/social-providers/index.ts` (+3 -0) ➕ `packages/core/src/social-providers/vercel.ts` (+87 -0) </details> ### 📄 Description This PR adds Vercel as additional OAuth provider, enabling users to authenticate with their Vercel accounts. ### Changes - Vercel can be configured as OAuth provider for login - PKCE is supported as it's required by Vercel - Configurable scopes: `openid`, `email`, `profile`, `offline_access` - Added docs to guide developers on how to set it up - Added to the "Create Sign in Box" configuration builder - Added tests - Extended the built-in demo app to include "Sign in with Vercel" ### Demo https://github.com/user-attachments/assets/145d68f9-7f4d-489b-8e0e-f2bb358f6bab <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added Vercel as an OAuth provider with required PKCE, so users can sign in with their Vercel accounts. Updated the demo, docs, and the configuration builder to make setup easy. - **New Features** - New Vercel provider (id: vercel) with PKCE and userinfo mapping. - Supports scopes: openid, email, profile, offline_access; passing scopes is optional. - mapProfileToUser supported for custom user fields. - Demo includes “Sign in with Vercel”; builder shows provider with icon. - Tests cover PKCE, scopes, callbacks, and existing-user flows. - **Migration** - Create a Vercel App and set redirect URL: /api/auth/callback/vercel. - Add env vars: VERCEL_APP_CLIENT_ID, VERCEL_APP_CLIENT_SECRET. - Configure socialProviders.vercel in auth.ts. - If you use createAuthorizationURL directly, scopes are now optional. <sup>Written for commit ab6cf973a11f3fca3e04db35ba339dc36cbdd581. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:39:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14834