Vercel integration: stop syncing SUPABASE_JWT_SECRET for projects on signing keys, and sync preview branch variables when the branch is created #54450
Unanswered
martijn00
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Two changes to the environment variables the Vercel integration syncs.
1. Don't sync
SUPABASE_JWT_SECRETto projects that sign with asymmetric keysThe Vercel Marketplace guide lists
SUPABASE_JWT_SECRETamong the variables every connected Vercel project gets, and "Preview branches on Vercel" syncs it for each preview branch too, next toSUPABASE_URLand the keys.For a project that has moved to JWT signing keys (ES256 or RS256), the value is the legacy shared secret. Apps verify tokens against the JWKS (
getClaims()does that), so they don't need it. But the secret can still sign a token for any user and role for as long as it isn't revoked, and after the migration it stays under "previously used" until someone revokes it. Syncing it puts a token-minting secret into every Vercel environment, including preview deployments of every pull request, where it serves no purpose.Ask: sync
SUPABASE_JWT_SECRETonly while the legacy secret is the current signing key, or make it opt-in on the integration page, and stop updating it once the project has switched to asymmetric keys. The guides could then say which projects get it.2. Sync a preview branch's variables when the branch is created
The preview branches guide says: "It syncs them when a pull request opens, not when the branch is created." A Supabase branch created without a pull request, such as a persistent
developorstagingbranch, or a branch created before its pull request, gets no variables in Vercel until a pull request opens. Until then its Vercel deployments use the variables set on the Vercel project, which usually point at production.Ask: sync the variables, scoped to the Git branch, when the Supabase branch is created or connected, and again when its keys change. Related: #40175, which asks to sync to a custom Vercel environment for a persistent branch.
Our case
We maintain open-source tooling around Supabase on Vercel. Its doctor warns about application code that reads
SUPABASE_JWT_SECRET(PD113), and our deployment docs mark the synced variable as unused outside Supabase Lite. Neither stops the secret from being present in every preview deployment.All reactions