Using the environment variables in my create-react-app application

PLEASE help us help you by writing a good post!

I have an app which works with subdomain redirection according to the username of the logged in user. I want to implement branch deploys for the staging environment.

The redirection happens from client side, so my current approach is to put in my custom url to the project and detect if the current deployment is a netlify deploy preview, if yes, then redirect to the deploy preview subdomain instead of user subdomain.

I am expecting that I can detect the deployment by getting DEPLOY_PRIME_URL but I am struggling with propagating that to my react build which is expecting the env to have a prefix like REACT_APP

I would appreciate any help on this one :blush:

hi there, did you see this guide already?