Sign up free
Reference

Environment Variables

Bloomberry requires a set of environment variables to connect to external services. These are split between the Next.js frontend (dashboard) and the Node.js backend.

Never commit secrets
Never commit .env files to version control. Use .env.local for local development (it is gitignored by default in Next.js projects).

Frontend — dashboard/.env.local

dashboard/.env.local
"color:#6e7681"># Backend connection
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001

"color:#6e7681"># Clerk authentication (public keys are safe to expose)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

"color:#6e7681"># Supabase (public URL is safe to expose)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...

Backend — backend/.env

backend/.env
"color:#6e7681"># Server
PORT=3001
NODE_ENV=development

"color:#6e7681"># AI models
GEMINI_API_KEY=AIza...
OPENAI_API_KEY=sk-...

"color:#6e7681"># Supabase (service key has full access — keep secret)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=eyJ...

"color:#6e7681"># Clerk (backend secret)
CLERK_SECRET_KEY=sk_test_...

"color:#6e7681"># Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_STARTER_PRICE_ID=price_...
STRIPE_PRO_PRICE_ID=price_...
STRIPE_TEAM_PRICE_ID=price_...

"color:#6e7681"># X (Twitter) OAuth
TWITTER_CLIENT_ID=...
TWITTER_CLIENT_SECRET=...
TWITTER_CALLBACK_URL=http://localhost:3001/api/connections/twitter/callback

"color:#6e7681"># LinkedIn OAuth
LINKEDIN_CLIENT_ID=...
LINKEDIN_CLIENT_SECRET=...
LINKEDIN_CALLBACK_URL=http://localhost:3001/api/connections/linkedin/callback

Variable reference

VariableServiceRequiredNotes
NEXT_PUBLIC_BACKEND_URLInternalYesBackend API URL; http://localhost:3001 for local dev
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYClerkYesSafe to expose; starts with pk_
CLERK_SECRET_KEYClerkYesKeep secret; starts with sk_
GEMINI_API_KEYGoogle AIYesPrimary generation model
OPENAI_API_KEYOpenAIOptionalFallback model; used if Gemini fails
SUPABASE_URLSupabaseYesProject URL from Supabase dashboard
SUPABASE_SERVICE_KEYSupabaseYesService role key — bypasses RLS; backend only
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabaseYesAnon key — respects RLS; safe to expose
STRIPE_SECRET_KEYStripeYes for billingBackend only; starts with sk_
STRIPE_WEBHOOK_SECRETStripeYes for billingFrom Stripe CLI or webhook endpoint dashboard
TWITTER_CLIENT_IDX (Twitter)Yes for XFrom developer.twitter.com
LINKEDIN_CLIENT_IDLinkedInYes for LinkedInFrom LinkedIn developer portal

Production environment

For production deployment (Vercel, Railway, or similar):

  1. Add all frontend variables to your Vercel project environment variables
  2. Add all backend variables to your backend service (Railway, Render, etc.)
  3. Update all callback URLs to your production domain
  4. Use production keys (not test keys) for Stripe, Clerk, and OAuth apps
  5. Ensure NEXT_PUBLIC_BACKEND_URL points to your deployed backend
Stripe webhooks in production
In production, register your webhook endpoint at https://your-domain.com/api/billing/webhook in the Stripe dashboard and copy the generated STRIPE_WEBHOOK_SECRET.
Edit this page on GitHub