Environment Settings
Environment variables configuration for Teak
Quick Setup
Configure 4 environment files:
Backend (backend/.env.local)
# Required
CONVEX_DEPLOYMENT=dev:name-123
CLERK_SECRET_KEY=sk_test_...
# Optional Features
OPENAI_API_KEY=sk_... # AI processing
POLAR_ACCESS_TOKEN=token # Billing
POLAR_SERVER=sandbox # sandbox|production
ADMIN_USERIDS=id1,id2 # Admin access
CLOUDFLARE_BROWSER_RENDERING_ACCOUNT_ID=id # Screenshots
CLOUDFLARE_BROWSER_RENDERING_API_TOKEN=token
CLERK_JWT_ISSUER_DOMAIN=domain.clerk.accounts.devWeb (apps/web/.env.local)
NEXT_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_CLERK_FRONTEND_API_URL=https://domain.clerk.accounts.dev
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/register
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/Mobile (apps/mobile/.env.local)
EXPO_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
EXPO_PUBLIC_CLERK_FRONTEND_API_URL=https://domain.clerk.accounts.devExtension (apps/extension/.env.local)
VITE_PUBLIC_CONVEX_URL=https://deployment.convex.cloud
VITE_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
VITE_PUBLIC_CLERK_SYNC_HOST=http://localhost:3000Getting Values
Convex
- Run
bun run predev→ creates deployment - Backend:
dev:name-123 - Frontend:
https://name.convex.cloud
Clerk
- Create app at clerk.com
- Frontend:
pk_test_...(Publishable Key) - Backend:
sk_test_...(Secret Key) - Configure in Convex dashboard → Settings → Authentication
Environment Types
| Environment | Convex | Clerk Keys |
|---|---|---|
| Development | dev:name-123 | pk_test_... / sk_test_... |
| Production | Production deployment | pk_live_... / sk_live_... |
Feature Flags
| Feature | Required Env Var | What it Enables |
|---|---|---|
| AI Processing | OPENAI_API_KEY | Auto-tags, summaries, categorization |
| Screenshots | CLOUDFLARE_BROWSER_RENDERING_* | Link preview thumbnails |
| Billing | POLAR_ACCESS_TOKEN | Subscription management |
| Admin Dashboard | ADMIN_USERIDS | Pipeline insights, monitoring |
Testing
E2E_CLERK_USER_EMAIL=test@example.com
E2E_CLERK_USER_PASSWORD=password123