sveltefire icon indicating copy to clipboard operation
sveltefire copied to clipboard

Firebase Remote Config

Open JeremyVoisin opened this issue 2 years ago • 0 comments

This PR adds support for Firebase RemoteConfig through multiple components:

  • RemoteConfig: This component instantiates a firebase RemoteConfig instance from the FirebaseApp. The big challenge with RemoteConfig is the SDK to require a browser context to be able to start. My solution is to create the remoteConfig instance in the onMount lifecycle hook. The downside is the need for the app to be passed in the context.
  • RemoteConfigString: Fetch a string variable from RemoteConfig
  • RemoteConfigNumber: Fetch a number variable from RemoteConfig
  • RemoteConfigBoolean: Fetch a boolean variable from RemoteConfig
  • RemoteConfigValue: Fetch a variable from RemoteConfig in the raw Value format

These components support the default value configured in RemoteConfig when configured.

JeremyVoisin avatar Aug 18 '23 20:08 JeremyVoisin