All integrations
Vercelintegrations.vercel

Code & deploy

Vercel

Export the live tokens at build time, and redeploy the site the moment a release is published.

  • build on publish
  • export at build

Vendor docs

What it does

  • Pull at build: the build runs stoaken export first, so every deployment ships the live release's tokens.
  • Push on publish: a standard Stoaken webhook calls a Vercel Deploy Hook, which accepts a bare POST with no authorisation or payload (docs), so a published release redeploys the site.

Before you start

  • A Stoaken API key and a stoaken.config.json with exports (see /docs/cli).
  • A Vercel project connected to a Git repository. Deploy Hooks need one.
  • Brand Admin in Stoaken, on the Team plan, for the webhook part.

Setup

  1. Under Project > Settings > Environment Variables, add STOAKEN_TOKEN (your API key) for Production and Preview.
  2. Make the build export first, either in vercel.json or in the project's Build Command (template: vercelJson() in src/lib/integrations/pipelines.ts):
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "buildCommand": "npx --yes stoaken@latest export && npm run build"
}
  1. Under Project > Settings > Git > Deploy Hooks, create a hook for your production branch and copy its URL.
  2. In Stoaken, choose Add a webhook, set Send as to Stoaken event, paste the hook URL as the address, and pick Release published.

Configuration

  • Leave out ?buildCache=false unless you need a clean build. The export doesn't depend on the cache.
  • If you also commit token files, add npx stoaken export --check to your Git provider's CI (see the GitHub, GitLab or Bitbucket guide) rather than to the Vercel build.

Try it

  1. Send test should get a 2xx from Vercel with a pending job in the body, and and start a deployment marked as from a Deploy Hook.
  2. The deployment's build log shows the stoaken export lines.

Troubleshooting

  • Build fails at export with 401: STOAKEN_TOKEN is missing for that environment, or the key was revoked.
  • No deployment: Vercel says github.enabled: false in vercel.json stops Deploy Hooks from working.
  • Fewer deployments than releases: Vercel cancels earlier hook deployments of the same version, and allows 60 hook triggers per hour per project.

Limits

  • A Deploy Hook redeploys one branch. It doesn't change your repository.
  • Anyone with the hook URL can redeploy. Brand Admins can see it in Stoaken, so revoke and replace it if it leaks.

Product names and logos are trademarks of their owners, shown only to say Stoaken works with their products; it doesn’t mean they endorse Stoaken.

Vercel, the Vercel design, Next.js and related marks, designs and logos are trademarks or registered trademarks of Vercel, Inc. or its affiliates in the US and other countries.