kavachOS
Authentication

Vercel

Sign in with Vercel using OAuth 2.0.

Setup

Get credentials

Go to vercel.com/integrations and click Add New Integration. Under OAuth 2.0, add your redirect URI:

https://your-app.com/api/kavach/auth/oauth/callback/vercel

Configure

lib/kavach.ts
import { createKavach } from 'kavachos';
import { oauth } from 'kavachos/auth';

const kavach = await createKavach({
  database: { provider: 'sqlite', url: 'kavach.db' },
  plugins: [
    oauth({
      providers: [
        {
          id: 'vercel',
          clientId: process.env.VERCEL_CLIENT_ID!,
          clientSecret: process.env.VERCEL_CLIENT_SECRET!,
        },
      ],
    }),
  ],
});
VERCEL_CLIENT_ID=...
VERCEL_CLIENT_SECRET=...

Scopes

Default scopes: user

ScopeWhat it unlocks
userRead user profile and email
deploymentsRead deployment info
projectsRead project info

Vercel OAuth apps are created as marketplace integrations. The access token grants access to the user's personal account and any teams they belong to.

Endpoints

MethodPathDescription
GET/auth/oauth/authorize/vercelRedirect to Vercel
GET/auth/oauth/callback/vercelHandle callback

On this page