Vercel’s build step runs in Node, regardless of whether your deployed functions run on Node or Edge. That means you canDocumentation Index
Fetch the complete documentation index at: https://docs.capy.sc/llms.txt
Use this file to discover all available pages before exploring further.
capy run -- next build during build, and Next.js inlines the decrypted values into the output bundle as string literals. Request-time functions read the literals - no runtime decryption, no service hop, nothing to load.
Setup (once per project)
-
Add Capy’s CLI as a dep so Vercel installs it during build:
-
Wrap your build (and dev) in
package.json: -
Point
next.config.jsat the generated env map.capy runemits.capy/next-env.jsduring build, containing every secret name it decrypted fromSECRETS_BLOB. Import it once:That’s it - no hand-maintained list. Add a secret to Capy, redeploy, Next picks it up automatically. -
Run
capy deployand pick Vercel. Capy prints two env vars -SECRETS_BLOBandPROJECT_KEY- and the setup page shows you the exact values. Paste them into Settings → Environment Variables in the Vercel dashboard (orvercel env add SECRETS_BLOB production/vercel env add PROJECT_KEY production). Repeat for Preview and Development if you want Capy to decrypt there too. -
Deploy. Vercel clones your branch, installs
@capy/cli, runscapy run -- next build, and the resulting bundle has your runtime values baked in. Both Node and Edge routes read them normally.
What happens during the build
- Runtime functions do zero crypto - they read already-inlined constants.
- Edge / Node / any framework - the mechanism is just
process.env. - One service call per build, not per request.
- Revocation = redeploy. Intentional; no caches to chase.
PROJECT_KEY never leaves the build step. Only the outer-wrapped portion of SECRETS_BLOB travels to Capy’s service; the service verifies the deploy token isn’t revoked and returns a one-way derived service_key. That’s combined locally with PROJECT_KEY to derive the key that actually opens the encrypted env. See Cryptography → Deploying for the exact construction.
Local development
Same wrapper, different command:capy run resolves the project key from your local keyring (populated by capy sync) - no SECRETS_BLOB / PROJECT_KEY required locally. See Getting started → Next.js for the end-to-end local loop.