Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/remote-config

Package Overview
Dependencies
Maintainers
4
Versions
2462
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/remote-config

The Remote Config package of the Firebase JS SDK

  • 0.4.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
increased by0.2%
Maintainers
4
Weekly downloads
 
Created

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

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc