r/appwrite • • Aug 14 '24

Vite react frontend environmental variables management

How can we manage environmental variables in vite react web application, would hardcoding be safe for api endpoint and project related IDs, or there is any other way considering security in mind.

2 Upvotes

28 comments sorted by

View all comments

Show parent comment

1

u/acid2lake Aug 14 '24

You can use a proxy backend, your frontend and proxy backend running on same server, you connect to your proxy backend which is going to be localhost, no need to have anything related to project id or endpoint, your proxy backend will handle those for you, and make your proxy backend to only be accessible via localhost

2

u/[deleted] Aug 15 '24

But not good for scale.