How to define and use environment variables?

I want to define token and a few APIs in the application, so how can I define them in development and production.

In the development mode, we can use environment variables by define variables in .env file.

But how variables will be packed in production.

Any help on this one?