Socket
Socket
Sign inDemoInstall

@firebase/remote-config

Package Overview
Dependencies
7
Maintainers
4
Versions
2310
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @firebase/remote-config

The Remote Config package of the Firebase JS SDK


Version published
Weekly downloads
1.6M
increased by0.66%
Maintainers
4
Install size
2.50 MB
Created
Weekly downloads
 

Package description

What is @firebase/remote-config?

The @firebase/remote-config package is part of the Firebase platform and provides tools to configure and customize the behavior and appearance of your app without needing to publish an app update. It allows developers to define parameters in the Firebase Console and use them in their app to modify app behavior for different users.

What are @firebase/remote-config's main functionalities?

Fetch and activate values

This feature allows developers to fetch remote configuration parameters and activate them in the app. The code sample demonstrates fetching and activating remote config values, then retrieving a specific parameter as a string.

const { getRemoteConfig, fetchAndActivate } = require('@firebase/remote-config');

async function fetchConfig() {
  const remoteConfig = getRemoteConfig();
  await fetchAndActivate(remoteConfig);
  const value = remoteConfig.getString('welcome_message');
  console.log('Welcome message:', value);
}

Set default values

This feature enables setting default values for configuration parameters within the app code. The code sample shows how to set a default value for a 'welcome_message' parameter, which will be used if no value is fetched from the server or while waiting for updated values.

const { getRemoteConfig, setDefaults } = require('@firebase/remote-config');

function setDefaultConfig() {
  const remoteConfig = getRemoteConfig();
  setDefaults(remoteConfig, {
    'welcome_message': 'Hello, default!'
  });
}

Other packages similar to @firebase/remote-config

Readme

Source

@firebase/remote-config

This is the Remote Config component of the Firebase JS SDK.

This package is not intended for direct usage, and should only be used via the officially supported firebase package.

Contributing

Setup:

  1. Run yarn in repo root

Format:

  1. Run yarn prettier in RC package

Unit test:

  1. Run yarn test in RC package

End-to-end test:

  1. Run yarn build in RC package
  2. Run yarn build in Firebase package
  3. Open test_app/index.html in a browser

FAQs

Last updated on 28 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc