Environment Variables
Learn how to use environment variables in your Remix project.
The starter project comes with two different environment variables files:
- .env: the main environment file
- .env.test: this environment file is loaded when running the Cypress E2E tests. You would rarely need to use this.
NB: the .env
file is never committed to the repository. This is because it contains sensitive information, such as API keys. Instead, we use a .env. template
file to show what the .env
file should look like.
The environment variables in your project will look like the below:
DEFAULT_LOCALE=enEMULATOR=trueSITE_URL=http://localhost:3000REQUIRE_EMAIL_VERIFICATION=false# FIREBASEGCLOUD_PROJECT=demo-makerkitFIREBASE_PROJECT_ID=demo-makerkitFIREBASE_STORAGE_BUCKET=demo-makerkit.appspot.comFIREBASE_AUTH_DOMAIN=localhostSERVICE_ACCOUNT_CLIENT_EMAIL=SERVICE_ACCOUNT_PRIVATE_KEY=# Change this with your project's APP IDFIREBASE_APP_ID=1:981813564016:web:f13148231721fcd0ee5ab5# Change this with your project's API KEYFIREBASE_API_KEY=AIzaSyAAqU_euGAMtJoXp0sECblAIndifCp0pmE# FIREBASE EMULATORFIRESTORE_EMULATOR_HOST=localhost:8080FIREBASE_AUTH_EMULATOR_HOST=localhost:9099FIREBASE_STORAGE_EMULATOR_HOST=localhost:9199FIREBASE_PUBSUB_EMULATOR_HOST=localhost:8085FIREBASE_EMULATOR_HOST=localhostFIRESTORE_EMULATOR_PORT=8080FIREBASE_AUTH_EMULATOR_PORT=9099FIREBASE_STORAGE_EMULATOR_PORT=9199# SERCET KEY TO SIGN SECRETS. REPLACE THE BELOW WITH A RANDOM AND COMPLEX STRING. KEEPT IT SAFE.SECRET_KEY=123456789# STRIPESTRIPE_WEBHOOK_SECRET=STRIPE_SECRET_KEY=# APPCHECKAPPCHECK_KEY=APPCHECK_DEBUG_TOKEN=
Define your environment variables in your hosting provider
NB: Remix will not bundle environment variables when building your app, but only during development mode.
Instead, you will need to define them in your hosting provider (such as your Vercel project settings).