Documentation

Guides and references

Getting Started

Supabase Setup

Create and configure a Supabase project for NextBento.

1. Create a Project

  1. Go to supabase.com and sign in
  2. Click New Project
  3. Choose your organization, name the project, set a database password
  4. Select a region and click Create new project
Supabase dashboard — New Project dialog

2. Get API Keys

Once the project is ready:

  1. Go to Project Settings (gear icon) → General
  2. Copy:
    • Project URLNEXT_PUBLIC_SUPABASE_URL
Supabase dashboard — Project URL
  1. Go to Project Settings (gear icon) → API
  2. Copy:
    • Publishable key key → NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY
    • Secret key key → SUPABASE_SECRET_KEY (keep this secret, server-side only)
Supabase dashboard — Project Secrets

3. Enable Auth Providers

Go to AuthenticationProviders and enable:

  • Email — For email/password and magic link
  • Google — For Google OAuth (add Client ID and Secret from Google Cloud Console)
  • GitHub — For GitHub OAuth (add Client ID and Secret from GitHub OAuth Apps)
OAuth callback URL

Add your callback URL in Google Cloud Console and GitHub OAuth App: https://YOUR_PROJECT.supabase.co/auth/v1/callback (Supabase handles the OAuth flow). For production, add your app redirect in Supabase: AuthenticationURL ConfigurationRedirect URLs (e.g. https://your-domain.com/auth/callback). To show your domain instead of Supabase on the Gmail consent screen, see Google Brand Verification.

Supabase Authentication → Providers

4. Row Level Security (RLS)

NextBento uses RLS policies to secure data. Run the migrations from the Supabase SQL Editor or CLI to apply the schema. The schema includes:

  • profiles — User profiles linked to auth.users
  • subscriptions — Stripe subscription state
  • teams — Team/organization data
  • team_members — Team membership
  • api_keys — API key storage (hashed)
  • activity_logs — Audit trail

5. Environment Variables

Add to .env.local:

NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=eyJ...
SUPABASE_SECRET_KEY=eyJ...

6. Local Development

For local development, use your Supabase project URL and keys. The Supabase SSR package handles session refresh via HTTP-only cookies. No additional config needed for localhost.

Next Steps