Skip to main content
@capgo/capacitor-firebase-functions Integrations Open source

Firebase Functions Capacitor plugin

Capacitor plugin for Firebase Cloud Functions

Install

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

Guide

How to use Firebase Functions in Capacitor

Using @capgo/capacitor-firebase-functions

Capacitor plugin for Firebase Cloud Functions.

Install

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

API at a glance

Method Description
callByName Call a callable function by name.
callByUrl Call a callable function by URL.
useEmulator Instrument your app to talk to the Cloud Functions emulator.

Examples

callByName()

Call a callable function by name.

import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';

const result = await FirebaseFunctions.callByName({ name: 'myFunction' });
console.log(result);

callByUrl()

Call a callable function by URL.

import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';

const result = await FirebaseFunctions.callByUrl({
  url: 'https://us-central1-my-project.cloudfunctions.net/myFunction',
});
console.log(result);

useEmulator()

Instrument your app to talk to the Cloud Functions emulator.

import { FirebaseFunctions } from '@capgo/capacitor-firebase-functions';

await FirebaseFunctions.useEmulator({ host: "127.0.0.1" });

Full reference

Keep going from Using @capgo/capacitor-firebase-functions

If you are using Using @capgo/capacitor-firebase-functions 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 Functions plugin FAQ

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

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

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

Yes. Firebase Functions 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-functions 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-functions free and open source?

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

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