> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kavachos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel

> Authenticate users with their Vercel account via the `oauth` plugin. Covers integration setup, redirect URI, and scopes for profile and project access.

## Setup

<Steps>
  <Step>
    ### Get credentials

    Go to [vercel.com/integrations](https://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
    ```
  </Step>

  <Step>
    ### Configure

    ```ts title="lib/kavach.ts" theme={"system"}
    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!,
            },
          ],
        }),
      ],
    });
    ```

    ```bash theme={"system"}
    VERCEL_CLIENT_ID=...
    VERCEL_CLIENT_SECRET=...
    ```
  </Step>
</Steps>

## Scopes

Default scopes: `user`

| Scope         | What it unlocks             |
| ------------- | --------------------------- |
| `user`        | Read user profile and email |
| `deployments` | Read deployment info        |
| `projects`    | Read project info           |

<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.
</Info>

## Endpoints

| Method | Path                           | Description        |
| ------ | ------------------------------ | ------------------ |
| GET    | `/auth/oauth/authorize/vercel` | Redirect to Vercel |
| GET    | `/auth/oauth/callback/vercel`  | Handle callback    |
