Skip to Content
LaunchfastDocs

Custom domain

Move from the vercel.app address to your own domain, and update everything that depends on the address.

Your address appears in several places: the app's own setting, the payment webhook, and the sign-in apps. All of them must change together.

Add the domain in Vercel

In the Vercel dashboard: your project → Settings → Domains → Add, and enter your domain, such as yourproduct.com. Vercel shows the DNS records to add at your domain registrar (usually an A record for the root domain and a CNAME for www). Wait until Vercel shows the domain as Valid Configuration.

Pick one address as the main one (with or without www) and let Vercel redirect the other to it.

Run setup with the domain

npm run setup

Answer Yes to deploying, keep the finished steps, and at Custom domain already connected to this project enter your main domain, such as yourproduct.com.

Setup then sets NEXT_PUBLIC_APP_URL to https://yourproduct.com, registers the webhook at https://yourproduct.com/api/webhooks/dodo, and redeploys.

Update sign-in apps

  • Google: add https://yourproduct.com as an authorized JavaScript origin and https://yourproduct.com/api/auth/callback/google as a redirect URI.
  • GitHub: set the production app's callback URL to https://yourproduct.com/api/auth/callback/github, and its homepage URL to https://yourproduct.com.

Remove the old webhook

In Dodo, Developer → Webhooks, delete the endpoint for the old vercel.app address, in the mode you're using. Otherwise Dodo keeps sending events there too.

Doing it without setup

  1. In Vercel, Settings → Environment Variables, set NEXT_PUBLIC_APP_URL=https://yourproduct.com.
  2. In Dodo, add a webhook endpoint for https://yourproduct.com/api/webhooks/dodo and set its secret as DODO_PAYMENTS_WEBHOOK_SECRET.
  3. Redeploy.
  4. Update Google and GitHub as above.

Use the address people actually land on

NEXT_PUBLIC_APP_URL must be the final address after redirects. If www.yourproduct.com redirects to yourproduct.com, use https://yourproduct.com. A mismatch breaks sign-in cookies and OAuth redirects.

On this page