1

I try to get a Remote Config value into a firebase function.

How can I achive this ?

------------------------ improved question after first hint from Doug ------------------------

There is a admin.remoteConfig().getTemplate() method available.

Below is a semi-working example.

In the code below, I see that defaultVal is of type RemoteConfigParameterValue?. But how do I convert it to a number in typescript ??

const remoteConfigTemplate = await admin.remoteConfig().getTemplate();

const defaultVal = remoteConfigTemplate.parameters["video_max_duration"].defaultValue

const videoMaxDurationDefaultValue: number = Number(defaultVal); // XXXXXX does not work XXXXXXXX
iKK
  • 6,394
  • 10
  • 58
  • 131

1 Answers1

2

Firebase Remote Config has an API available through the Firebase Admin SDK. You can also use the REST API.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441