Skip to main content

Firebase Remote Config Capacitor plugin

Capacitor plugin for Firebase Remote Config

Install

bun add @capgo/capacitor-firebase-remote-config bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-firebase-remote-config
  • pnpm add @capgo/capacitor-firebase-remote-config
  • yarn add @capgo/capacitor-firebase-remote-config

Guide

How to use Firebase Remote Config in Capacitor

Using @capgo/capacitor-firebase-remote-config

Capacitor plugin for Firebase Remote Config.

Install

bun add @capgo/capacitor-firebase-remote-config
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

API at a glance

Method Description
activate Make the last fetched configuration available to the getters.
fetchAndActivate Perform fetch and activate operations.
fetchConfig Fetch and cache configuration from the Remote Config service.
getBoolean Get the value for the given key as a boolean.
getNumber Get the value for the given key as a number.
getString Get the value for the given key as a string.
getAll Get all the values from the Remote Config service.
getInfo Get information about the last fetch operation.
setMinimumFetchInterval Set the minimum fetch interval.
setDefaults Sets config defaults for parameter keys and values in the default namespace config.
setSettings Set the remote config settings.
addConfigUpdateListener Add a listener for the config update event.
removeConfigUpdateListener Remove a listener for the config update event.

Examples

activate()

Make the last fetched configuration available to the getters.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.activate();

fetchAndActivate()

Perform fetch and activate operations.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.fetchAndActivate();

fetchConfig()

Fetch and cache configuration from the Remote Config service.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.fetchConfig();

getBoolean()

Get the value for the given key as a boolean.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

const result = await FirebaseRemoteConfig.getBoolean({ key: 'key-123' });
console.log(result);

getNumber()

Get the value for the given key as a number.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

const result = await FirebaseRemoteConfig.getNumber({ key: 'key-123' });
console.log(result);

getString()

Get the value for the given key as a string.

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

const result = await FirebaseRemoteConfig.getString({ key: 'key-123' });
console.log(result);

The table above lists the 13 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Full reference

Keep going from Using @capgo/capacitor-firebase-remote-config

If you are using Using @capgo/capacitor-firebase-remote-config to plan native plugin work, connect it with Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives, and Capgo Native Builds for the product workflow in Capgo Native Builds.

FAQ

Firebase Remote Config plugin FAQ

How do I install the Firebase Remote Config plugin in a Capacitor app?

Run "bun add @capgo/capacitor-firebase-remote-config" (or "npm install @capgo/capacitor-firebase-remote-config"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-firebase-remote-config" in your app code.

Does @capgo/capacitor-firebase-remote-config work with React, Vue and Angular?

Yes. Firebase Remote Config is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-firebase-remote-config support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-firebase-remote-config free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-firebase/tree/main/packages/remote-config and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Firebase Remote Config without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Firebase Remote Config changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo