Getting Started with Supabase
Learn how to set up Supabase auth and database for this starter with env vars, redirects, and a seed script.
Building tools for makers

Why Supabase?
Supabase combines auth, Postgres, storage, and real-time APIs with a simple client and a solid free tier. This starter uses Supabase for user accounts and server-side data so you can skip building your own auth stack.
1) Create a project
Go to supabase.com and create a new project. Copy your URL and anon/service keys from Project Settings → API.
2) Add environment variables
Add your credentials to .env.local:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-keyThe anon key is safe for the browser and powers the client provider. The service role key stays server-side for webhooks and admin tasks.
3) Seed the database
Use the included seed to create minimal tables and RLS policies:
npm run seed:supabaseThis sets up profiles (auth users + billing access) and leads (marketing capture) with sensible defaults.
4) Configure auth redirect URLs
In Supabase → Authentication → URL Configuration, set:
- Site URL:
http://localhost:3000for local dev, your domain for production. - Redirect URLs:
http://localhost:3000/auth/callback(and your prod domain). The login page sends users here after magic links or OAuth.
5) Enable providers
Turn on Email (magic links) and any OAuth providers you need (e.g. Google). The starter uses signInWithOtp and signInWithOAuth with the redirect above.
6) Test locally
Run npm run dev, request a magic link, and confirm you land on /auth/callback then your dashboard. Check the profiles table to see the user row; Stripe webhooks will flip has_access when billing is wired.
Common gotchas
- Redirect URLs must match exactly (protocol + path).
- Keep the service role key server-only.
- If you swap price IDs in
config.ts, webhooks will upsert the profile with the correct ID automatically.
Ready to ship faster?
LaunchKit gives you auth, payments, CRM, and everything you need to launch your SaaS in days, not months.
Get LaunchKitWritten by
LaunchKit TeamWe're a small team passionate about helping developers and entrepreneurs ship products faster. LaunchKit is our contribution to the maker community.
Related Articles

How Long It Really Takes to Launch a SaaS
Ignore the 'ship in a weekend' hype. Here's the honest timeline for launching a SaaS that can actually generate revenue.

Claude Code for SaaS Founders: Idea to Revenue
Complete playbook for solo founders using Claude Code to launch a SaaS. From validation to first paying customer in 3 weeks.

Build a SaaS MVP in 24 Hours with Claude Code
Step-by-step tutorial: Build a complete SaaS MVP in 24 hours using Claude Code, Next.js, and Supabase. Includes auth, payments, CRM, and deployment.