DocsRecipes

Vercel preview DBs

Spin up a fresh seedkit ephemeral DB per Vercel preview deploy — and tear it down when the PR closes.


Sketch

npm install && \
npx seedkit-cli new --schema prisma/schema.prisma --seed pr-$VERCEL_GIT_COMMIT_REF --env && \
npm run build

Each preview deploy gets a fresh ephemeral DB, written to .env.local for the build. Use the seed name pr-<branch> so subsequent builds on the same branch hit the cache instead of regenerating.

See also