How setup works
npm run setup takes a fresh clone to a working app, and optionally a live deployment. This page explains what it does, in what order, and how re-running it works.
npm run setupThe setup script runs on your computer with your own accounts. It asks for each API key, tells you exactly where to find it, and does the rest through each service's API.
What it does, in order
| Step | What happens | Required? |
|---|---|---|
| Start | Warns you if the site still shows the example product "Acme". Asks whether to deploy to Vercel at the end | — |
| 1. Auth secret | Generates BETTER_AUTH_SECRET and sets NEXT_PUBLIC_APP_URL to http://localhost:3000 | Automatic |
| 2. Database | Creates a Neon Postgres database, checks your network can reach it, and creates the tables | Required |
| 3. Payments | Checks your Dodo API key, works out test or live mode, and creates one Dodo product per plan | Required |
| 4. Email | Adds your sending domain to Resend and creates its DNS records | Optional locally, needed for email sign-in in production |
| 5. Social sign-in | Walks you through creating Google and GitHub OAuth apps | Optional |
| 6. Deploy | Sets every variable on Vercel, deploys, registers the payment webhook and checks the site loads | Only if you chose to deploy |
Your keys stay with you
Every value is saved to .env.local in your project folder (and to Vercel, if you deploy). Nothing is sent anywhere else. .env.local is in .gitignore, so it's never committed.
Stopping and re-running
Each step saves as soon as it finishes. You can press Ctrl+C at any question, or close the terminal, and run npm run setup again later.
When you re-run it, finished steps ask "… is already set up. Keep it?":
- Yes keeps the saved value and moves on.
- No redoes that step, for example to paste a new Dodo API key.
Social sign-in is the exception: once a provider's client ID is saved, setup skips it. To redo it, delete the GOOGLE_… or GITHUB_… lines from .env.local and run setup again.
Re-running is safe
Setup never creates duplicates. Dodo products are found by a tag on each plan, the webhook is found by its URL, and existing Resend domains and DNS records are reused.
The "Customise the site first" warning
If src/config.ts still says name: "Acme", setup starts with:
The site still shows the example product "Acme", with its example plans.
…
Continue setup with the example plans anyway?Setup creates a Dodo product for every plan in src/config.ts, so running it now would create Acme's "Starter" and "Pro" products in your Dodo account. Choose No, run the Make it yours task, then run setup again.
Choosing Yes is fine if you only want to try the kit. You can archive the example products in Dodo later.
The first question: deploy or not
Deploy to Vercel at the end? (choose No to set up local development only)- No sets up local development. You can deploy later by running setup again and answering Yes.
- Yes also offers Resend by default (production needs email for email sign-in), shows production URLs in the sign-in guides, and deploys at the end.
If something fails
Setup prints a short error and stops:
Setup stopped. Fix the problem above, then run `npm run setup` again; finished steps are kept.Find the message in Setup errors.