Environments
Configure environment variables for your MinuteShip application
MinuteShip requires several environment variables to function properly, and this guide explains how to set them up step by step.
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
Learn how to obtain and configure the Token in the Cloudflare guide.
| Variable | Description |
|---|---|
| CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID (for Wrangler CLI and Cloudflare REST API) |
| CLOUDFLARE_API_TOKEN | Cloudflare API token (for Wrangler CLI and Cloudflare REST API) |
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.
MinuteShip uses Cloudflare Email Service as the default and preferred email provider, with Resend available as an alternative. Use the tabs below to see the environment variables for each provider.
Cloudflare Email
| Variable | Description |
|---|---|
| CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID |
| CLOUDFLARE_API_TOKEN | Cloudflare API token with Email Sending Write permission |
Resend
| Variable | Description |
|---|---|
| RESEND_API_KEY | API key for Resend email service |
Note: The
RESEND_API_KEYis shared between the Email and Newsletter modules when using Resend.
Storage
Learn how to set up storage in the Storage Setup guide.
MinuteShip uses Cloudflare R2 binding for storage, no additional environment variables are needed.
Cache
Learn how to set up cache in the Cache Setup guide.
MinuteShip uses Cloudflare KV binding for server-side cache, no additional environment variables are needed.
Payment
Learn how to set up payments in the Payment Setup guide.
MinuteShip supports Stripe, Creem, and Waffo Pancake as payment providers.
Stripe
Learn how to set up Stripe in the Stripe Setup guide.
| Variable | Description |
|---|---|
| VITE_PAYMENT_PROVIDER | Set to stripe to enable Stripe as payment provider |
| 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 |
Creem
Learn how to set up Creem in the Creem Setup guide.
| Variable | Description |
|---|---|
| VITE_PAYMENT_PROVIDER | Set to creem to enable Creem as payment provider |
| CREEM_API_KEY | Creem API key |
| CREEM_WEBHOOK_SECRET | Creem webhook signing secret |
| CREEM_DEBUG | Set to true to use Creem sandbox API (optional) |
| VITE_CREEM_PRODUCT_PRO_MONTHLY | Creem product ID for pro monthly subscription |
| VITE_CREEM_PRODUCT_PRO_YEARLY | Creem product ID for pro yearly subscription |
| VITE_CREEM_PRODUCT_LIFETIME | Creem product ID for lifetime one-time payment |
Waffo
Learn how to set up Waffo in the Waffo Setup guide.
| Variable | Description |
|---|---|
| VITE_PAYMENT_PROVIDER | Set to waffo to enable Waffo Pancake as payment provider |
| WAFFO_MERCHANT_ID | Waffo merchant ID (from Dashboard > API & Development) |
| WAFFO_PRIVATE_KEY | Waffo RSA private key (server-side only, PEM with escaped \n) |
| WAFFO_DEBUG | Set to true to accept test-mode webhooks in a production build (optional, smoke testing only) |
| VITE_WAFFO_PRODUCT_PRO_MONTHLY | Waffo product ID for pro monthly subscription |
| VITE_WAFFO_PRODUCT_PRO_YEARLY | Waffo product ID for pro yearly subscription |
| VITE_WAFFO_PRODUCT_LIFETIME | Waffo product ID for lifetime one-time payment |
Newsletter
Learn how to set up newsletter in the Newsletter Setup guide.
MinuteShip supports Resend, Beehiiv, and MailCheap as newsletter providers. Only configure the variables for your selected provider.
Resend
| Variable | Description |
|---|---|
| RESEND_API_KEY | API key for Resend newsletter service (shared with email module) |
Note: The
RESEND_API_KEYis shared between the Email and Newsletter modules when using Resend.
Beehiiv
| Variable | Description |
|---|---|
| BEEHIIV_API_KEY | API key for Beehiiv newsletter service |
| BEEHIIV_PUBLICATION_ID | Publication ID for Beehiiv newsletter |
MailCheap
| Variable | Description |
|---|---|
| MAILCHEAP_API_KEY | MailCheap Full access API key, for server-side use only |
| MAILCHEAP_NEWSLETTER_ID | ID or slug of the target MailCheap newsletter |
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 Analytics 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 |
Verifying Environment Variables
To verify that your environment variables are correctly set up, run:
pnpm run dev
If 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:
- Website Configuration: Configure website settings
- Getting Started: MinuteShip template getting started guide
- Database: Configure database
- Cache: Configure server-side cache
- Deployment: Deploy to Cloudflare Workers