Environments
Configure environment variables for your TanStarter application
TanStarter requires several environment variables to function properly, and this guide explains how to set them up.
Environment Variables
Website Configuration
| Variable | Description |
|---|---|
| VITE_BASE_URL | The public URL of your site, e.g. http://localhost:3000 for development, https://your-domain.com for production |
Cloudflare API Token
Learn how to obtain and configure the Token in the Cloudflare API Token guide.
| Variable | Description |
|---|---|
| CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID (for Wrangler CLI and Drizzle Kit remote operations) |
| CLOUDFLARE_API_TOKEN | Cloudflare API token (for Wrangler CLI and Drizzle Kit remote operations) |
Database
Learn how to set up a database in the Database Setup guide.
| Variable | Description |
|---|---|
| CLOUDFLARE_DATABASE_ID | Cloudflare D1 database ID (for Drizzle Kit remote operations) |
Authentication
Learn how to set up authentication in the Authentication Setup guide.
| Variable | Description |
|---|---|
| BETTER_AUTH_SECRET | A random string used to hash tokens and sign cookies |
| GOOGLE_CLIENT_ID | Google OAuth client ID (optional) |
| GOOGLE_CLIENT_SECRET | Google OAuth client secret (optional) |
Learn how to set up email in the Email Setup guide.
| Variable | Description |
|---|---|
| RESEND_API_KEY | API key for Resend email service |
Newsletter
Learn how to set up newsletter in the Newsletter Setup guide.
| Variable | Description |
|---|---|
| RESEND_API_KEY | API key for Resend email service |
Storage
Learn how to set up storage in the Storage Setup guide.
TanStarter uses Cloudflare R2 binding for storage, no additional environment variables are needed.
Payment
Learn how to set up payments in the Payment Setup guide.
| Variable | Description |
|---|---|
| STRIPE_SECRET_KEY | Stripe secret key |
| STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret |
| VITE_STRIPE_PRICE_PRO_MONTHLY | Stripe price ID for pro monthly subscription |
| VITE_STRIPE_PRICE_PRO_YEARLY | Stripe price ID for pro yearly subscription |
| VITE_STRIPE_PRICE_LIFETIME | Stripe price ID for lifetime one-time payment |
Notification
Learn how to set up notification in the Notification Setup guide.
| Variable | Description |
|---|---|
| DISCORD_WEBHOOK_URL | Discord webhook URL for receiving notifications |
| FEISHU_WEBHOOK_URL | Feishu webhook URL for receiving notifications |
Analytics
Learn how to set up analytics in the Analytics Setup guide.
| Variable | Description |
|---|---|
| VITE_GOOGLE_ANALYTICS_ID | Google Analytics ID |
| VITE_UMAMI_WEBSITE_ID | Umami Analytics website ID |
| VITE_UMAMI_SCRIPT | Umami Analytics script URL |
| VITE_PLAUSIBLE_SCRIPT | Plausible Analytics script URL |
| VITE_CLARITY_PROJECT_ID | Clarity project ID |
Chatbox
Learn how to set up chatbox in the Chatbox Setup guide.
| Variable | Description |
|---|---|
| VITE_CRISP_WEBSITE_ID | Crisp Chat ID for website live chat |
Affiliates
Learn how to set up affiliates in the Affiliates Setup guide.
| Variable | Description |
|---|---|
| VITE_AFFILIATE_AFFONSO_ID | Affonso affiliate marketing ID |
| VITE_AFFILIATE_PROMOTEKIT_ID | Promotekit affiliate marketing ID |
Verifying Environment Variables
To verify that your environment variables are correctly set up, run:
pnpm devIf everything is configured correctly, your application should start and run normally without any environment-related errors.
Next Steps
Now that your environment is set up, explore these related topics:
TanStarter Docs