Vercel
Deploy your Swarmz project to Vercel with zero config and per-branch preview URLs
The Vercel integration connects your workspace to a Vercel account, lets you link a Swarmz project to a Vercel project, and deploys the linked project on every push. Vercel auto-detects the framework (Next.js, Vite, Astro, Remix, SvelteKit, plain React), wires up the right build settings, and ships to its global edge network.
The deploy path is GitHub-driven by default — you push to the linked GitHub repo, Vercel sees the push, and starts a build. You can also kick off a manual deploy from the Swarmz editor without going through GitHub, useful when you want to ship something without committing it to a public branch.
Setup
Go to Settings → Integrations and click Vercel.
A popup opens with Vercel's authorization screen. Pick the scope — your personal account or a Vercel team — and approve.
The popup closes. The Vercel card flips to Connected with the team name displayed.
Internally, the OAuth flow runs through the integration-oauth edge function with provider: "vercel". The exchange happens against https://api.vercel.com/v2/oauth/access_token, the access token is encrypted with TOKEN_ENCRYPTION_KEY, and a row is inserted into workspace_connections with integration_id = "vercel".
Linking a project
You can link a Swarmz project to a Vercel project two ways:
Open the project, click Deploy in the editor toolbar, and choose Vercel.
Either pick an existing Vercel project from the list, or click Create new and Swarmz makes one for you (named after your Swarmz project, attached to the GitHub repo if one is linked).
For brand-new projects, the Create new flow is the fast path — Swarmz creates the Vercel project, attaches it to your linked GitHub repo (so deploys auto-trigger), and runs an initial deploy. The first deploy URL appears in the editor in 30–90 seconds.
How deploys trigger
Once linked, deploys happen in two ways:
| Trigger | What happens |
|---|---|
| Git push | When the linked GitHub repo receives a push, Vercel starts a build automatically. Pushes to main deploy to production; every other branch gets a preview URL. This is the default and works with no extra setup. |
| Manual deploy from editor | Click Deploy → Deploy now in the editor toolbar. Swarmz calls the Vercel API to create a deployment from the project's current container state, even if it isn't committed yet. |
The manual path is useful when you want to share a preview URL without committing — say, sharing a draft with a reviewer before merging — or when GitHub isn't connected at all and you want to deploy straight from the project's container.
Environment variables
Environment variables are managed in two places:
- Swarmz project settings (
Project Settings → Environment Variables) — used by the live preview and the agent. Stored encrypted at rest and only injected at container runtime. - Vercel project settings — used by your production and preview deploys.
To keep them in sync, Swarmz can push variables from the project settings to Vercel on each deploy. Toggle this with Auto-sync env to Vercel on the Vercel card. It maps:
Swarmz development env → Vercel "Development" environment
Swarmz preview env → Vercel "Preview" environment
Swarmz production env → Vercel "Production" environmentVariables marked as secrets stay encrypted on both sides — Swarmz never sees the decrypted Vercel value, and Vercel never receives the variable in plain text over the wire (Vercel's API encrypts in transit).
Custom domains
Custom domains live with Vercel, not Swarmz. After deploying:
Open the linked Vercel project's dashboard.
Go to Settings → Domains and add your domain.
Update your DNS records as Vercel instructs.
Vercel issues SSL certificates automatically — no manual setup needed.
Reading deploy status
The editor toolbar shows the latest deploy's status (queued, building, ready, errored) and surfaces build logs inline if a deploy fails. Click View logs to get the full Vercel build output without leaving Swarmz.
If a build fails, the agent can read the logs and take a shot at fixing the cause:
The latest Vercel deploy failed. Read the logs and fix it.The agent will pull the build log via the Vercel API, identify the error (missing env var, type error, peer-dep mismatch), make the change, and trigger another deploy.
Disconnecting
Settings → Integrations → Vercel → Disconnect revokes the OAuth token and removes the workspace_connections row. Existing Vercel projects keep running — disconnect only severs the link from Swarmz. To delete the actual Vercel project, do that from the Vercel dashboard.
If you disconnect Vercel and then want to deploy somewhere else, see Netlify for the equivalent flow on the other major platform.