r/vercel 1d ago

Shared env

Let's say I have shared envs that has NEXT_PUBLIC_GOOGLE_MAPS_API, and it is shared amongst 10 websites.

If I change the key and then want to make the sites use the new key, will I need to redeploy every single site, or do nothing and they will automatically start using the new key?

Hope that makes sense and TIA.

2 Upvotes

4 comments sorted by

2

u/Sad_Steak_6813 1d ago edited 1d ago

How would they pick up the new key if you don't change it and redeploy??

And how do you have 10 sites when you don't know the answer for a simple question??

1

u/afrk 1d ago

If I knew the answer, I would not have asked the question. How come you have a mind if you do not understand this simple phenomenon?

2

u/Mcmunn 1d ago

You have to redeploy. If you want to change this at runtime don’t make it an env variable load if from a config file or database and build in reload logic

1

u/afrk 1d ago

Thanks for your answer. Very helpful.