1. 18
    Expose Specific Environmental Variables to The Client Using Remix
    4m 56s

Expose Specific Environmental Variables to The Client Using Remix

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

We want to make it so that only admins can access the admin routes. To do that, we need to add support for environment variables. Using Remix, we can choose which environment variables to expose to our front or backend.

Using an env.server file, we can create a function that returns an admin email address that we can use for accessing those admin routes. This will allow the front-end access to an env variable. You can still use regular env variables for server-side.