Environment Settings
Environment variables reference for Teak applications
Required Environment Variables
You need to configure environment variables across three locations:
packages/backend/.env.local
CONVEX_DEPLOYMENT=dev:your-deployment-name-123
CLERK_SECRET_KEY=sk_test_your_clerk_secret_key_here
apps/web/.env.local
NEXT_PUBLIC_CONVEX_URL=https://your-convex-deployment.convex.cloud
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key_here
apps/mobile/.env.local
EXPO_PUBLIC_CONVEX_URL=https://your-convex-deployment.convex.cloud
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key_here
Getting Your Values
Convex URLs
- Run
bun run predev
to create your deployment - Copy the deployment URL from the Convex dashboard
- Use the deployment name (e.g.,
dev:name-123
) for the backend - Use the full URL (e.g.,
https://name.convex.cloud
) for frontend apps
Clerk Keys
- Create a Clerk application at clerk.com
- Get your Publishable Key (
pk_test_...
) from the dashboard - Get your Secret Key (
sk_test_...
) from API Keys section - Configure Clerk in Convex dashboard: Settings → Authentication
Development vs Production
Environment | Convex | Clerk Keys | Notes |
---|---|---|---|
Development | dev:name-123 | pk_test_... / sk_test_... | Local development |
Production | Production deployment | pk_live_... / sk_live_... | Live environment |
Security
- Never commit
.env.local
files to version control - Use different keys for development and production
- Rotate keys regularly