Environment variables

Learn how to set environment variables in your Remix project and how to use them in your code.

Makerkit ships with some environment variables pre-configured for you.

If you don't have experience with environment variables, you can think of them as a way to store configuration values for your project.

Remix ships with a .env file that contains the following variables:

DEFAULT_LOCALE=en SITE_URL=http://localhost:3000 # set the below to "production" in your production environment ENVIRONMENT=development # SUPABASE SUPABASE_URL=http://localhost:54321 SUPABASE_ANON_KEY= SUPABASE_SERVICE_ROLE_KEY= # STRIPE STRIPE_WEBHOOK_SECRET= STRIPE_SECRET_KEY= NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= # EMAIL EMAIL_HOST= EMAIL_PORT=587 EMAIL_USER= EMAIL_PASSWORD= EMAIL_SENDER='MakerKit Team <info@makerkit.dev>'

NB: Remix only used the .env file during development. If you want to use environment variables in production, you need to set them in your hosting provider.

If I set mt variables in Vercel/another hosting provider, do I still need to set them in my project?

No. If you set your environment variables in your hosting provider, you don't need to set them in your project.

Can I add secrets to my environment variables, like my OpenAI API key?

No. You should never add secrets to your environment variables. Instead, you should use your CI provider to set them.

Does Remix automatically load my environment variables?

No - or better - only during development. Which means that you need to set them in your hosting provider if you want to use them in production.


Subscribe to our Newsletter
Get the latest updates about React, Remix, Next.js, Firebase, Supabase and Tailwind CSS