SecureStartKit

Deployment

Deploy to Vercel and configure your custom domain.

Deploy to Vercel

  1. Push your code to GitHub
  2. Go to vercel.com and click Add New Project
  3. Import your GitHub repository
  4. Add your environment variables (copy from .env.local):
VariableValue
NEXT_PUBLIC_APP_URLhttps://yourdomain.com (must include https://)
NEXT_PUBLIC_SUPABASE_URLYour Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anon key
SUPABASE_SERVICE_ROLE_KEYSupabase service role key
STRIPE_SECRET_KEYYour Stripe secret key (sk_live_...)
STRIPE_WEBHOOK_SECRETYour production webhook secret (whsec_...)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYYour Stripe publishable key (pk_live_...)
RESEND_API_KEYYour Resend API key (optional)
  1. Click Deploy

Important: NEXT_PUBLIC_APP_URL must include the protocol (https://). Setting it to just yourdomain.com without https:// will cause the build to fail with an "Invalid URL" error.

Custom Domain

Use your bare domain (e.g., yourdomain.com) as the primary domain, not www.yourdomain.com. This is the industry standard for SaaS apps.

  1. In Vercel, go to Settings > Domains
  2. Add yourdomain.com as your primary domain
  3. Add www.yourdomain.com as a redirect to yourdomain.com
  4. Vercel will automatically redirect all www traffic to the non-www version

DNS Configuration

In your domain registrar's DNS settings, add:

TypeNameValue
A@76.76.21.21
CNAMEwwwcname.vercel-dns.com

Vercel will generate an SSL certificate automatically.

Update your environment variables

After adding your domain, update these values:

  1. Vercel: Set NEXT_PUBLIC_APP_URL to https://yourdomain.com
  2. config.ts: Set domainName to yourdomain.com (no https://, no trailing slash)
  3. Supabase: Update the Site URL and Redirect URLs in Authentication > URL Configuration:
    • Site URL: https://yourdomain.com
    • Add redirect: https://yourdomain.com/auth/callback
  4. Stripe: Create a production webhook endpoint pointing to https://yourdomain.com/api/webhooks/stripe

SEO Checklist

After deploying, verify your SEO setup:

  • https://yourdomain.com/sitemap.xml returns your sitemap
  • https://yourdomain.com/robots.txt allows crawling of public pages
  • https://yourdomain.com/opengraph-image returns your OG image
  • All URLs in sitemap use https://yourdomain.com (non-www, with protocol)
  • Google Search Console is set up and sitemap is submitted

Redeploying

Vercel automatically redeploys when you push to your main branch. To trigger a manual redeploy:

  1. Go to your project in the Vercel dashboard
  2. Click Deployments > latest deployment > Redeploy

Or use the Vercel CLI:

npx vercel --prod