How can I set environment in card react code?

I have below code to return Card context:

```

fetch(url)…

return (
<>
<EmptyState title=“Payment” layout=“vertical” imageName=“building”>
<Text>Transaction</Text>
</EmptyState>
</>
);

```

In above code, I need to determinte the environment it is running. The environment can be developer, test, staging and prod. These enviroments are critical for our software development lifecycle. The code would be a little different for different environments. e.g. the fetch URL is different based on the environment. How can I pass the environment name to this code?

Hi @JZhao

Thanks for posting! I want to share a couple of resources for your exact same issue:

And these Community Threads
https://community.hubspot.com/t5/CMS-Development/Where-to-put-env-file-in-CMS-React-Boilderplate/m-p/411218

https://community.hubspot.com/t5/CMS-Development/How-to-use-environment-variables/m-p/306673

I’m tagging a few experts who can help us out here. Hey there, @evaldas , @DilshadShaikh , and @kosalaindrasiri . I hope you’re having a great week! Any ideas for this issue?

Thanks

Victor