Setup Environment Variables
Environment variables are required to configure third-party services such as Stripe, Firebase, and Mailgun. Follow these steps to set them up:
Steps to set up Environment Variables
1. Create a .env
File
- In the root of your project, create a new file named
.env
.
2. Add Environment Variables
-
Add the following variables to your
.env
file:STRIPE_SECRET_KEY=<your_secret_key> STRIPE_WEBHOOK_SECRET=<your_webhook_secret> STRIPE_PUBLISHABLE_KEY=<your_publishable_key> FREE_PLAN_PRICE_ID=<your_free_plan_id> PLAN_1_PRICE_ID=<your_plan_1_id> PLAN_2_PRICE_ID=<your_plan_2_id> MAILGUN_API_KEY=<your_mailgun_api_key> MAILGUN_DOMAIN=<your_mailgun_domain> SUPPORT_EMAIL=<your_support_email>
-
You can download a preconfigured
.env.development
file containing Stripe test keys for immediate use in your development environment. The file includes necessary keys for testing and setting up Stripe but does not include Mailgun configuration. After downloading, please rename the file to.env.development
before placing it in the root of your project.
-
3. Replace Placeholder Values
- Replace the placeholder values (e.g.,
<your_secret_key>
) with the actual credentials from the Stripe and Mailgun dashboards. The next steps will guide you on how to set up Stripe and Mailgun. Be sure to add the values obtained from those services to the environment variables above.