# Vercel

Connect an Envshed project to a Vercel project once. Every deploy pulls fresh secrets from Envshed — no manual environment-variable updates in the Vercel dashboard, no drift between staging and production.

:::note Planned
The native Vercel integration is planned. Until then, the [workaround below](#workaround-today) covers the same use case using the CLI.
:::

## How it will work

- **Connect once** — install the Envshed app from the Vercel marketplace and pick which Envshed environment maps to each Vercel target (`development`, `preview`, `production`).
- **Sync on every deploy** — Envshed pushes the current values into Vercel before each build, so the Vercel runtime reads them as native env vars.
- **One source of truth** — rotate a secret in Envshed, redeploy, done. No more "did anyone update Vercel?" in Slack.
- **Audit trail intact** — every push is logged in Envshed, so you keep one timeline of who changed what across both systems.

## Workaround today

You can already deploy to Vercel with secrets sourced from Envshed using a [service token](../features/service-tokens) and the CLI. Two patterns work today.

### Option 1 — `envshed run` in the build command

Wrap the Vercel build command with `envshed run` so secrets exist in the build environment without ever being copied into the Vercel dashboard.

In `vercel.json`:

```json
{
  "buildCommand": "envshed run -e production -- pnpm build"
}
```

Add a single `ENVSHED_TOKEN` env var to the Vercel project (use a [service token](../features/service-tokens) with read access to the target environment). The CLI uses it to fetch every other secret on each build.

### Option 2 — script that calls the REST API

If you would rather not install the CLI on the Vercel build image, hit the REST API directly from a build script and write the values to `.env.production.local` before `next build`. See the [pull command](../cli/pull) and the underlying API for the exact shape.

Either pattern keeps secrets out of the Vercel UI and gives you the same rotate-once behavior the native integration will have.

## Want this sooner?

The native integration is sequenced behind a couple of other items on the [public roadmap](https://envshed.com/roadmap). If Vercel is the integration that would unblock you, email [contact@envshed.com](mailto:contact@envshed.com?subject=Vercel%20integration%20%2B1) with a one-liner about your setup — every reply moves it up the queue.

## Related

- [GitHub Actions](./github-actions) — same pattern in CI before the deploy
- [Docker](./docker) — for self-hosted or container-based Vercel alternatives
- [Service tokens](../features/service-tokens) — how to scope the build token correctly
- [Public roadmap](https://envshed.com/roadmap)
