radlinskii
radlinskii

Reputation: 13

Setting Firebase config inside Firebase Functions

is there a way to update configuration variables of my app within app's code?

I want to get the effect of running:

firebase functions:config:set service.client_secret='YMzPjIaVZBZKLRgGq' in one of my functions.

I'm looking for something like this:

functions.config.allegro.refresh_token = json.refresh_token;

Thanks in advance!

Upvotes: 1

Views: 49

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317868

This is not possible. Environment variables are effectively deployed along with your functions. Just like the code of your function can't be modified at runtime, your env vars also can't be modified. You need to redeploy your functions to get new configs.

If you need dynamic configs, consider storing them in a database instead.

Upvotes: 1

Related Questions