Skip to main content
@capgo/capacitor-firebase-app-check Auth & Security Open source

Firebase App Check Capacitor plugin

Capacitor plugin for Firebase App Check

Install

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

Guide

How to use Firebase App Check in Capacitor

Using @capgo/capacitor-firebase-app-check

Capacitor plugin for Firebase App Check.

Install

bun add @capgo/capacitor-firebase-app-check
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 { FirebaseAppCheck } from '@capgo/capacitor-firebase-app-check';

API at a glance

Method Description
getToken Get the current App Check token.
initialize Activate App Check for the given app. Can be called only once per app.
setTokenAutoRefreshEnabled Set whether the App Check token should be refreshed automatically or not.

Examples

getToken()

Get the current App Check token.

import { FirebaseAppCheck } from '@capgo/capacitor-firebase-app-check';

const result = await FirebaseAppCheck.getToken();
// The result holds sensitive values: use it without logging it.

initialize()

Activate App Check for the given app. Can be called only once per app.

import { FirebaseAppCheck } from '@capgo/capacitor-firebase-app-check';

await FirebaseAppCheck.initialize();

setTokenAutoRefreshEnabled()

Set whether the App Check token should be refreshed automatically or not.

import { FirebaseAppCheck } from '@capgo/capacitor-firebase-app-check';

await FirebaseAppCheck.setTokenAutoRefreshEnabled({ enabled: true });

Listen to events

addListener returns a handle. Call handle.remove() when the screen unmounts, or FirebaseAppCheck.removeAllListeners() to clear every listener.

Full reference

Keep going from Using @capgo/capacitor-firebase-app-check

If you are using Using @capgo/capacitor-firebase-app-check 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 App Check plugin FAQ

How do I install the Firebase App Check plugin in a Capacitor app?

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

Does @capgo/capacitor-firebase-app-check work with React, Vue and Angular?

Yes. Firebase App Check 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-app-check 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-app-check free and open source?

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

Can I update code that uses Firebase App Check 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 App Check 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