# Deploy to Vercel

Drop on Vercel Functions, with a Cloudflare D1 database, a private Vercel Blob store for files, and a Vercel Cron Job that deletes expired code images.

[Deploy to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvite-hub%2Fdrop&env=GITHUB_CLIENT_ID%2CGITHUB_CLIENT_SECRET%2CBETTER_AUTH_SECRET%2CDROP_ADMINS%2CCLOUDFLARE_ACCOUNT_ID%2CCLOUDFLARE_API_TOKEN%2CCLOUDFLARE_D1_DATABASE_ID%2CCLOUDFLARE_D1_DATABASE_NAME&envDescription=GitHub+sign-in%2C+admin+emails%2C+Cloudflare+D1%2C+and+a+private+Blob+store.+See+the+Drop+guide+for+each+value.&envLink=https%3A%2F%2Fdrop.vitehub.dev%2Fdocs%2Fself-host%2Fvercel&stores=%5B%7B%22type%22%3A%22blob%22%7D%5D)

## Deploy with the button

The button clones the repository, creates a Vercel project, prompts for its settings, and opens the Blob store setup. Vercel's build environment selects the Vercel host. `vercel.json` installs with the pinned pnpm version, builds, and applies D1 migrations before publishing.

1. [Create a D1 database and account API token](https://drop.vitehub.dev/docs/self-host.md#database). You need the account id, token, database id, and database name.
2. At the Storage step, choose or create a **private** Blob store. Vercel connects it and supplies `BLOB_READ_WRITE_TOKEN`. The `stores` parameter requests Blob, but does not select its access mode.
3. Choose your project name, then [create the GitHub OAuth app](https://drop.vitehub.dev/docs/self-host.md#github) with `https://<project>.vercel.app/api/auth/callback/github`. Supply its credentials, a generated auth secret, and your admin email.
4. If the flow offers only a public store, create a private one in the dashboard under Storage, connect it to the project, and redeploy. Drop requires private Blob access. If you change the domain, update the OAuth callback.

| Database | D1 over HTTP |
| --- | --- |
| Files | Vercel Blob |
| Rate limits | Per instance |
| Code images | SVG |
| Code image cleanup | Vercel Cron Job |

## Settings

| Variable | What it is |
| --- | --- |
| GITHUB\_CLIENT\_ID | Your GitHub OAuth app's client ID. |
| GITHUB\_CLIENT\_SECRET | A client secret from the same app. |
| BETTER\_AUTH\_SECRET | Signs sessions and agent tokens. One per deployment: openssl rand -base64 32 |
| DROP\_ADMINS | Admin emails, comma-separated. Whoever signs in with one of them is Admin. |
| VITEHUB\_WEBHOOKS\_KEY | Seals each member's agent for Send, the URL and its secret: openssl rand -base64 32. A new key disconnects every agent. |
| VITEHUB\_MEMBERS | Optional. Only these people (and the admins) sign in, open shared links, and use MCP: github:\<id>, verified emails, @domains, or github-org:\<org>, comma-separated. |
| DROP\_MODE | Optional. team for a Drop one team runs: everyone signed in is a teammate, and new drops start shared with the Team. Defaults to personal. |
| DROP\_PUBLIC\_LINK\_DAYS | Optional. Days a public link stays open. Empty: 7 on a team Drop, no limit on a personal one. 0 turns public links off. |
| CLOUDFLARE\_ACCOUNT\_ID, CLOUDFLARE\_API\_TOKEN | Cloudflare account id and an account API token with D1 edit access. |
| CLOUDFLARE\_D1\_DATABASE\_ID, CLOUDFLARE\_D1\_DATABASE\_NAME | Your D1 database id and name. |
| BLOB\_READ\_WRITE\_TOKEN | Added by Vercel when you connect the Blob store. |

## Database

Cloudflare D1 over HTTPS. `pnpm db:migrate` skips migrations already applied and refuses migrations that lose existing data. A fresh database needs no override. For an upgrade that reports an intentional removal, back up the database and run `pnpm db:migrate --allow-data-loss` once after reviewing `pnpm db:migrate --dry-run`. The configured Vercel build runs it after building. Disable previews or give them a separate D1 database.

To update, [pull Drop's changes into your repository](https://drop.vitehub.dev/docs/self-host.md#update) and push.

## On Vercel

- Code images are SVG only: PNG needs Cloudflare Browser Run.
- Rate limits count in memory per function instance, so they're looser than on Cloudflare.
- Files go to a private Blob store, and Drop serves them at `/f/` after checking access.
- A Vercel Cron Job deletes expired code images once a day, which works on the Hobby plan. Expired images stop being served immediately.
