Skip to main content
AnotherWrapper doesn’t use one giant config file. Instead, configuration is spread across four layers — each with a clear purpose. Here’s the full map.
Don’t try to configure everything on day one. Start with pnpm bootstrap, get the app running, then add features one at a time.

The four config layers

.env.example is the source of truth. pnpm bootstrap generates a working .env.local from it.This is where you configure:
  • Auth (Better Auth secret, URLs)
  • Database (DATABASE_URL)
  • AI provider keys
  • Payments
  • Email
  • Analytics
  • Storage
  • Meta attribution
  • Sentry

Env var reference

These are the bare minimum to run the app:
NEXT_PUBLIC_APP_URL=http://localhost:3000
BETTER_AUTH_SECRET=...
DATABASE_URL=postgresql://...
Plus at least one AI provider:
OPENAI_API_KEY=sk-...
Email/password works with just BETTER_AUTH_SECRET.For magic links and forgot password, add:
NEXT_PUBLIC_EMAIL_PROVIDER=resend
EMAIL_PROVIDER=resend
AUTH_EMAIL_FROM="YourApp <[email protected]>"
NEXT_PUBLIC_EMAIL_PROVIDER controls whether the auth UI shows magic-link and reset-password modes. EMAIL_PROVIDER is the server-side provider selection.For Google OAuth:
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true
For Loops auth-email templates:
LOOPS_AUTH_MAGIC_LINK_TRANSACTIONAL_ID=...
LOOPS_AUTH_RESET_PASSWORD_TRANSACTIONAL_ID=...
DATABASE_URL=postgresql://...
Best practices:
  • Use pnpm db:migrate to apply schema changes
  • Use pnpm db:generate to create SQL after schema edits
  • Keep custom SQL migrations small and focused
You only need the providers you plan to use:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GOOGLE_GENERATIVE_AI_API_KEY=...
GROQ_API_KEY=...
XAI_API_KEY=...
DEEPSEEK_API_KEY=...
REPLICATE_API_TOKEN=...
ELEVENLABS_API_TOKEN=...
PDF RAG requires OpenAI for embeddings. Image/video generation often needs Replicate. Voice needs ElevenLabs.
Required for uploads, file-backed workflows, and generated assets:
STORAGE_REGION=...
STORAGE_ACCESS_KEY=...
STORAGE_SECRET_KEY=...
STORAGE_ENDPOINT=...
STORAGE_BUCKET=...
STORAGE_PUBLIC_URL=...
Without storage, these features won’t work: chat file upload, PDF flows, image/video/voice outputs, vision uploads.
NEXT_PUBLIC_PAYMENT_PROVIDER=stripe
NEXT_PUBLIC_DEFAULT_MARKETING_PURCHASE_TYPE=plan-medium
NEXT_PUBLIC_CHECKOUT_URL_TEMPLATE=...
Plus the secret for your chosen provider:
  • STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET
  • LEMON_SQUEEZY_WEBHOOK_SECRET
  • POLAR_WEBHOOK_SECRET
NEXT_PUBLIC_EMAIL_PROVIDER=none
EMAIL_PROVIDER=none
Switch to loops, resend, or brevo when you want auth emails or contact sync. Then add the matching key:
  • LOOPS_API_KEY
  • RESEND_API_KEY
  • BREVO_API_KEY
And for auth emails: AUTH_EMAIL_FROM (required) and AUTH_EMAIL_REPLY_TO (optional).
One or more providers, comma-separated:
NEXT_PUBLIC_ANALYTICS_PROVIDER=posthog,datafast
Then configure the specific provider env vars. See Analytics for details.
Optional — only if you run Meta Ads:
NEXT_PUBLIC_ENABLE_META_ATTRIBUTION=false
NEXT_PUBLIC_META_PIXEL_ID=
META_ACCESS_TOKEN=
NEXT_PUBLIC_SENTRY_DSN=...
Server-side overrides and tracing are optional.
Don’t try to fill every env var at once. Go in this order:
1

Run pnpm bootstrap

Let the wizard handle the initial setup.
2

Better Auth + DATABASE_URL

The absolute minimum to run the app.
3

One AI provider

OpenAI, Anthropic, or Google — just pick one to start.
4

Replicate (optional)

If you want image and video generation early.
5

Payment provider

When you’re ready to charge money.
6

Email provider

When you want magic links, password resets, or contact sync.
7

Analytics

When you want to understand user behavior.
8

Extras

Meta attribution, Sentry, additional AI providers — add as needed.
  • Using .env instead of .env.local
  • Missing BETTER_AUTH_SECRET
  • Forgetting DATABASE_URL
  • Enabling email auth flows without AUTH_EMAIL_FROM
  • Enabling provider features without the matching API key
  • Expecting uploads to work without storage configured
  • Setting payment env vars but forgetting checkout URLs
  • Editing generated SQL by hand instead of updating lib/db/schema/*
  • Forgetting that NEXT_PUBLIC_APP_URL affects auth redirects

Get Started

Follow the setup guide first.

Troubleshooting

Something not working? Check here.

Launch Checklist

Ready to ship? Verify everything.