LogoShipSaaS

Environment Configuration

Configure environment variables for your ShipSaaS application

ShipSaaS requires a few environment variables to function correctly. This document will walk you through setting up these environment variables step-by-step.

Environment Variables

Website Configuration

VariableDescription
VITE_BASE_URLThe URL of your website, e.g., http://localhost:3000 for development, or https://your-domain.com for production

Cloudflare

Learn how to get and configure tokens in the Cloudflare document.

VariableDescription
CLOUDFLARE_ACCOUNT_IDCloudflare Account ID (used by Wrangler CLI and Cloudflare REST API)
CLOUDFLARE_API_TOKENCloudflare API Token (used by Wrangler CLI and Cloudflare REST API)

Database

Learn how to set up the database in the Database Configuration document.

VariableDescription
CLOUDFLARE_DATABASE_IDCloudflare D1 Database ID (used for Drizzle Kit remote operations)

Storage

Learn how to set up storage in the Storage Configuration document.

ShipSaaS uses Cloudflare R2 bindings for storage, so no additional environment variables are required.

Authentication

Learn how to set up authentication in the Authentication document.

VariableDescription
BETTER_AUTH_SECRETA random string used for hashing tokens and signing cookies
GOOGLE_CLIENT_IDGoogle OAuth Client ID (optional)
GOOGLE_CLIENT_SECRETGoogle OAuth Client Secret (optional)

Email

Learn how to set up email functionality in the Email document.

ShipSaaS supports Resend and Cloudflare Email Service as email service providers.

Cloudflare Email

VariableDescription
RESEND_API_KEYAPI Key for the Resend email service

Note: When using Resend, the RESEND_API_KEY can be shared between the email module and the newsletter subscription module.

Resend

VariableDescription
CLOUDFLARE_ACCOUNT_IDCloudflare Account ID
CLOUDFLARE_API_TOKENCloudflare API Token, requiring Email Sending Write permissions

Payments

Learn how to set up payments in the Payment Configuration document.

ShipSaaS supports Stripe and Creem as payment providers.

Stripe

Learn how to set up Stripe in the Stripe Configuration document.

VariableDescription
VITE_PAYMENT_PROVIDERSet to stripe to enable the Stripe payment provider
STRIPE_SECRET_KEYStripe Secret Key
STRIPE_WEBHOOK_SECRETStripe Webhook Signature Secret
VITE_STRIPE_PRICE_PRO_MONTHLYStripe Price ID for the Pro Plan monthly subscription
VITE_STRIPE_PRICE_PRO_YEARLYStripe Price ID for the Pro Plan yearly subscription
VITE_STRIPE_PRICE_LIFETIMEStripe Price ID for the Lifetime Plan

Creem

Learn how to set up Creem in the Creem Configuration document.

VariableDescription
VITE_PAYMENT_PROVIDERSet to creem to enable the Creem payment provider
CREEM_API_KEYCreem API Key
CREEM_WEBHOOK_SECRETCreem Webhook Signature Secret
CREEM_DEBUGSet to true to use the Creem sandbox testing environment (optional)
VITE_CREEM_PRODUCT_PRO_MONTHLYCreem Product ID for the Pro Plan monthly subscription
VITE_CREEM_PRODUCT_PRO_YEARLYCreem Product ID for the Pro Plan yearly subscription
VITE_CREEM_PRODUCT_LIFETIMECreem Product ID for the Lifetime Plan

AI

Learn how to set up AI features in the AI document.

VariableDescription
FAL_API_KEYfal.ai API Key for image generation, created in the fal.ai Dashboard

Newsletter

Learn how to set up newsletter subscriptions in the Newsletter document.

ShipSaaS supports Resend and Beehiiv as newsletter service providers.

Resend

VariableDescription
RESEND_API_KEYResend API Key for newsletter subscription service (shared with email module)

Note: When using Resend, the RESEND_API_KEY can be shared between the email module and the newsletter subscription module.

Beehiiv

VariableDescription
BEEHIIV_API_KEYBeehiiv API Key for newsletter subscription service
BEEHIIV_PUBLICATION_IDBeehiiv Publication ID for newsletter subscription service

Notifications

Learn how to set up notifications in the Notification document.

VariableDescription
DISCORD_WEBHOOK_URLDiscord Webhook URL for receiving notifications
FEISHU_WEBHOOK_URLFeishu Webhook URL for receiving notifications

Analytics

Learn how to set up analytics in the Analytics document.

VariableDescription
VITE_GOOGLE_ANALYTICS_IDGoogle Analytics ID
VITE_UMAMI_WEBSITE_IDUmami Analytics Website ID
VITE_UMAMI_SCRIPTUmami Analytics Script URL
VITE_PLAUSIBLE_SCRIPTPlausible Analytics Script URL
VITE_CLARITY_PROJECT_IDClarity Analytics Project ID

Chatbox

Learn how to set up the Crisp Chatbox in the Chatbox document.

VariableDescription
VITE_CRISP_WEBSITE_IDCrisp Chat ID, used for the live chat function on your website

Affiliate Marketing

Learn how to set up affiliate marketing in the Affiliate document.

VariableDescription
VITE_AFFILIATE_AFFONSO_IDAffonso Affiliate Marketing ID
VITE_AFFILIATE_PROMOTEKIT_IDPromoteKit Affiliate Marketing ID

Verifying Environment Variables

To verify that your environment variables are correctly configured, run:

bun run dev

If everything is correctly configured, your application should start and run normally without any environment-related errors.

Next Steps

Now that your environment is configured, explore these related topics:

On this page