Deploy to Vercel
Deploy the supported PostgreSQL, Better Auth, and Resend production baseline safely.
Vercel is the production path exercised by the VibeAny Starter release gate. The supported baseline uses a hosted PostgreSQL database, Better Auth email/password authentication, and Resend. Optional provider-backed capabilities stay disabled until you configure and test them separately.
The
deploy:vercelcommand is deliberately a narrow baseline. It requires payments, Google One Tap, and AI image generation to be disabled. Read Payment-enabled deployments before changing those flags.
Prerequisites
- Node.js
>=24.0.1and npm>=11.3.0 - A Vercel account and a project dedicated to this application
- A hosted PostgreSQL connection URL
- A strong Better Auth secret
- A Resend API key and a sender address on a verified domain
- A clean working tree with reviewed SQL migrations committed under
drizzle/
The deployment script pins Vercel CLI 54.21.1, so a global CLI installation is not required.
1. Link the intended project
Run these commands from the starter root:
npx --yes vercel@54.21.1 login
npx --yes vercel@54.21.1 linkBefore continuing, inspect the generated .vercel/project.json and confirm that it names the project you intend to deploy. The .vercel/ directory is local state and is ignored by Git. Relink if the project or team is wrong; do not continue and hope to correct the target after deployment.
2. Configure the baseline environment
Add the following values to the Vercel Production environment. Use the final production origin, without a trailing path, for all three URL variables.
| Variable | Required value |
|---|---|
DATABASE_URL | Hosted PostgreSQL URL, including the provider's required TLS parameters |
BETTER_AUTH_SECRET | A new random secret, for example from openssl rand -base64 32 |
BETTER_AUTH_URL | https://your-domain.example |
NEXT_PUBLIC_SITE_URL | https://your-domain.example |
NEXT_PUBLIC_APP_URL | https://your-domain.example |
NEXT_PUBLIC_ENABLE_EMAIL_AUTH | true |
RESEND_API_KEY | Resend server credential |
RESEND_FROM_EMAIL | Sender on a verified domain |
NEXT_PUBLIC_ENABLE_PAYMENTS | false |
NEXT_PUBLIC_ENABLE_ONE_TAP | false |
NEXT_PUBLIC_ENABLE_IMAGE_GENERATION | false |
Pull those Production values into the starter's ignored deployment file:
npx --yes vercel@54.21.1 env pull .env.production.local --environment=productionNever commit .env.production.local or paste its contents into an issue, build log, or support request.
3. Preflight, migrate, and deploy
Run the single baseline entrypoint:
npm run deploy:vercelIt loads application configuration from .env.production.local, sets the production runtime marker so child commands do not read .env.local, and stops at the first failed step:
npm run preflight
npm run db:migrate
npx --yes vercel@54.21.1 --prod --yesThe wrapper imports only known application variables from the deployment file. Runtime values such as PATH and npm configuration remain controlled by the invoking environment.
To use an environment file outside the repository, pass its absolute path:
npm run deploy:vercel -- /absolute/path/to/production.envInside the repository, a deployment environment filename must match the ignored .env*.local convention.
4. Verify the production baseline
After Vercel reports success, verify behavior on the deployed origin:
- Open the home page and localized login page.
- Register with email and password.
- Receive and follow the verification email.
- Sign in, sign out, and sign in again.
- Request and complete a password reset.
- Open the dashboard and account pages as the authenticated user.
- Confirm that payments, One Tap, and image generation remain unavailable.
A successful build or redirect is not sufficient proof. Check the real browser flow, Resend delivery status, application logs, and the expected PostgreSQL rows.
Payment-enabled deployments
The current npm run deploy:vercel wrapper requires NEXT_PUBLIC_ENABLE_PAYMENTS=false. This is intentional: it represents the independently verified core deployment baseline, not every optional capability combination.
Do not describe that wrapper as a payment-enabled production deployment command, and do not bypass its check by hiding the active flags. Configure and test payments using the payments overview, then treat enabling payments as a separate production change with its own target-environment preflight, sandbox-to-live verification, webhook delivery, and database read-back. The current starter does not package that change as a one-command production wrapper.
Changing production configuration
For a baseline environment change:
- Update the value in the intended Vercel project.
- Pull
.env.production.localagain. - Confirm the local project binding.
- Run
npm run deploy:vercelagain. - Repeat production verification.
Read Operations for the exact preflight, migration, cron, webhook, and upgrade semantics.