VibeAny Docs

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:vercel command 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.1 and 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.

Run these commands from the starter root:

npx --yes vercel@54.21.1 login
npx --yes vercel@54.21.1 link

Before 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.

VariableRequired value
DATABASE_URLHosted PostgreSQL URL, including the provider's required TLS parameters
BETTER_AUTH_SECRETA new random secret, for example from openssl rand -base64 32
BETTER_AUTH_URLhttps://your-domain.example
NEXT_PUBLIC_SITE_URLhttps://your-domain.example
NEXT_PUBLIC_APP_URLhttps://your-domain.example
NEXT_PUBLIC_ENABLE_EMAIL_AUTHtrue
RESEND_API_KEYResend server credential
RESEND_FROM_EMAILSender on a verified domain
NEXT_PUBLIC_ENABLE_PAYMENTSfalse
NEXT_PUBLIC_ENABLE_ONE_TAPfalse
NEXT_PUBLIC_ENABLE_IMAGE_GENERATIONfalse

Pull those Production values into the starter's ignored deployment file:

npx --yes vercel@54.21.1 env pull .env.production.local --environment=production

Never 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:vercel

It 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 --yes

The 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.env

Inside 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:

  1. Open the home page and localized login page.
  2. Register with email and password.
  3. Receive and follow the verification email.
  4. Sign in, sign out, and sign in again.
  5. Request and complete a password reset.
  6. Open the dashboard and account pages as the authenticated user.
  7. 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:

  1. Update the value in the intended Vercel project.
  2. Pull .env.production.local again.
  3. Confirm the local project binding.
  4. Run npm run deploy:vercel again.
  5. Repeat production verification.

Read Operations for the exact preflight, migration, cron, webhook, and upgrade semantics.

On this page