---
description: Unofficial Capacitor plugin for Firebase Cloud Functions SDK to call backend functions in your app with support for Android, iOS, and Web.
title: Capacitor Firebase Cloud Functions Plugin - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/firebase/cloud-functions.png
---

[ Skip to content](#capacitor-firebasefunctions) 

[ 🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode.](/blog/announcing-the-capacitor-vault-plugin/) 

* [  SDKs ](/docs/sdks/)
* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Cloud Messaging ](/docs/sdks/capacitor/firebase/cloud-messaging/)
* [  Cloud Storage ](/docs/sdks/capacitor/firebase/cloud-storage/)
* [  Performance Monitoring ](/docs/sdks/capacitor/firebase/performance-monitoring/)
* [  Remote Config ](/docs/sdks/capacitor/firebase/remote-config/)
* [  Formbricks ](/docs/sdks/capacitor/formbricks/)
* [  Geocoder ](/docs/sdks/capacitor/geocoder/)
* [  Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [  Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [  libSQL ](/docs/sdks/capacitor/libsql/)
* [  Live Update ](/docs/sdks/capacitor/live-update/)
* [  Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [  Media Session ](/docs/sdks/capacitor/media-session/)
* [  ML Kit ](/docs/sdks/capacitor/mlkit/)
* [  Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [  NFC ](/docs/sdks/capacitor/nfc/)
* [  OAuth ](/docs/sdks/capacitor/oauth/)
* [  Pedometer ](/docs/sdks/capacitor/pedometer/)
* [  Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [  PostHog ](/docs/sdks/capacitor/posthog/)
* [  Printer ](/docs/sdks/capacitor/printer/)
* [  Purchases ](/docs/sdks/capacitor/purchases/)
* [  RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [  Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [  Screenshot ](/docs/sdks/capacitor/screenshot/)
* [  Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [  Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [  Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [  Share Target ](/docs/sdks/capacitor/share-target/)
* [  Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [  SQLite ](/docs/sdks/capacitor/sqlite/)
* [  Superwall ](/docs/sdks/capacitor/superwall/)
* [  Torch ](/docs/sdks/capacitor/torch/)
* [  Vault ](/docs/sdks/capacitor/vault/)
* [  Wifi ](/docs/sdks/capacitor/wifi/)
* [  Zip ](/docs/sdks/capacitor/zip/)
* [  Cordova ](/docs/sdks/cordova/)
* [  Cloud ](/docs/cloud/)
* [  Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [  Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [  FAQ ](/docs/cloud/live-updates/faq/)
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Set Up Environments ](/docs/cloud/native-builds/environments/)
* [  Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [  Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [  Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [  Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [  Use pnpm or Yarn ](/docs/cloud/native-builds/package-managers/)
* [  Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [  Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [  Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [  Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [  Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [  Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  FAQ ](/docs/cloud/native-builds/faq/)
* [  App Store Publishing ](/docs/cloud/app-store-publishing/)
* [  Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [  Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [  Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [  FAQ ](/docs/cloud/app-store-publishing/faq/)
* [  Automations ](/docs/cloud/automations/)
* [  Reference ](/docs/cloud/automations/reference/)
* [  Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [  FAQ ](/docs/cloud/automations/faq/)
* [  Assist ](/docs/cloud/assist/)
* [  CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Integrations ](/docs/cloud/integrations/)
* Account
* [  Organization ](/docs/cloud/organizations/)
* [  Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [  Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [  Billing ](/docs/cloud/organizations/billing/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  AI ](/docs/ai/)
* [  Insiders ](/docs/insiders/)
* [  Billing & Plans ](/docs/insiders/billing-and-plans/)
* [  FAQ ](/docs/insiders/faq/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/support/)
* [  Contributing ](/docs/contributing/)
* Contributing code
* [  Code of Conduct ](/docs/contributing/code-of-conduct/)
* [  Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Changelog ](#changelog)
* [  License ](#license)

# @capacitor-firebase/functions[¶](#capacitor-firebasefunctions "Permanent link")

Unofficial Capacitor plugin for [Firebase Cloud Functions](https://firebase.google.com/docs/functions/).[1](#fn:1)

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capacitor-firebase/functions` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capacitor-firebase/functions
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

Add Firebase to your project if you haven't already ([Android](https://firebase.google.com/docs/android/setup) / [iOS](https://firebase.google.com/docs/ios/setup)).

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

If needed, you can define the following project variable in your app’s `variables.gradle` file to change the default version of the dependency:

* `$firebaseFunctionsVersion` version of `com.google.firebase:firebase-functions` (default: `22.1.0`)

This can be useful if you encounter dependency conflicts with other plugins in your project.

### iOS[¶](#ios "Permanent link")

#### Swift Package Manager[¶](#swift-package-manager "Permanent link")

Add the following to your `capacitor.config.json` (or `capacitor.config.ts`) to avoid a [SwiftPM package identity collision](https://github.com/capawesome-team/capacitor-firebase/issues/959):

`[](#%5F%5Fcodelineno-3-1){
[](#%5F%5Fcodelineno-3-2)  "experimental": {
[](#%5F%5Fcodelineno-3-3)    "ios": {
[](#%5F%5Fcodelineno-3-4)      "spm": {
[](#%5F%5Fcodelineno-3-5)        "packageOptions": {
[](#%5F%5Fcodelineno-3-6)          "@capacitor-firebase/functions": {
[](#%5F%5Fcodelineno-3-7)            "symlink": true
[](#%5F%5Fcodelineno-3-8)          }
[](#%5F%5Fcodelineno-3-9)        }
[](#%5F%5Fcodelineno-3-10)      }
[](#%5F%5Fcodelineno-3-11)    }
[](#%5F%5Fcodelineno-3-12)  }
[](#%5F%5Fcodelineno-3-13)}
`

**Attention**: SPM `packageOptions` support requires Capacitor CLI **8.4.0+**.

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Demo[¶](#demo "Permanent link")

A working example can be found here: [robingenz/capacitor-firebase-plugin-demo](https://github.com/robingenz/capacitor-firebase-plugin-demo)

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-4-1)import { FirebaseFunctions } from '@capacitor-firebase/functions';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const callByName = async () => {
[](#%5F%5Fcodelineno-4-4)    const { data } = await FirebaseFunctions.callByName({
[](#%5F%5Fcodelineno-4-5)        name: 'helloWorld',
[](#%5F%5Fcodelineno-4-6)        data: {
[](#%5F%5Fcodelineno-4-7)            string: 'Hello World!',
[](#%5F%5Fcodelineno-4-8)            number: 123,
[](#%5F%5Fcodelineno-4-9)            boolean: true,
[](#%5F%5Fcodelineno-4-10)            array: [1, 2, 3],
[](#%5F%5Fcodelineno-4-11)            object: {
[](#%5F%5Fcodelineno-4-12)                key: 'value'
[](#%5F%5Fcodelineno-4-13)            }
[](#%5F%5Fcodelineno-4-14)        }
[](#%5F%5Fcodelineno-4-15)    });
[](#%5F%5Fcodelineno-4-16)    return data;
[](#%5F%5Fcodelineno-4-17)};
[](#%5F%5Fcodelineno-4-18)
[](#%5F%5Fcodelineno-4-19)const callByUrl = async () => {
[](#%5F%5Fcodelineno-4-20)    const { data } = await FirebaseFunctions.callByUrl({
[](#%5F%5Fcodelineno-4-21)        url: 'https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/helloWorld',
[](#%5F%5Fcodelineno-4-22)        data: {
[](#%5F%5Fcodelineno-4-23)            string: 'Hello World!',
[](#%5F%5Fcodelineno-4-24)            number: 123,
[](#%5F%5Fcodelineno-4-25)            boolean: true,
[](#%5F%5Fcodelineno-4-26)            array: [1, 2, 3],
[](#%5F%5Fcodelineno-4-27)            object: {
[](#%5F%5Fcodelineno-4-28)                key: 'value'
[](#%5F%5Fcodelineno-4-29)            }
[](#%5F%5Fcodelineno-4-30)        }
[](#%5F%5Fcodelineno-4-31)    });
[](#%5F%5Fcodelineno-4-32)    return data;
[](#%5F%5Fcodelineno-4-33)};
[](#%5F%5Fcodelineno-4-34)
[](#%5F%5Fcodelineno-4-35)const useEmulator = async () => {
[](#%5F%5Fcodelineno-4-36)  await FirebaseFunctions.useEmulator({
[](#%5F%5Fcodelineno-4-37)    host: '10.0.2.2',
[](#%5F%5Fcodelineno-4-38)    port: 9001,
[](#%5F%5Fcodelineno-4-39)  });
[](#%5F%5Fcodelineno-4-40)};
`

## API[¶](#api "Permanent link")

* [callByName(...)](#callbyname)
* [callByUrl(...)](#callbyurl)
* [useEmulator(...)](#useemulator)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### callByName(...)[¶](#callbyname "Permanent link")

`[](#%5F%5Fcodelineno-5-1)callByName<RequestData = unknown, ResponseData = unknown>(options: CallByNameOptions<RequestData>) => Promise<CallByNameResult<ResponseData>>
`

Call a callable function by name.

| Param       | Type                                                 |
| ----------- | ---------------------------------------------------- |
| **options** | [CallByNameOptions](#callbynameoptions)<RequestData> |

**Returns:** `Promise<[CallByNameResult](#callbynameresult)<ResponseData>>`

**Since:** 6.1.0

---

### callByUrl(...)[¶](#callbyurl "Permanent link")

`[](#%5F%5Fcodelineno-6-1)callByUrl<RequestData = unknown, ResponseData = unknown>(options: CallByUrlOptions<RequestData>) => Promise<CallByUrlResult<ResponseData>>
`

Call a callable function by URL.

| Param       | Type                                               |
| ----------- | -------------------------------------------------- |
| **options** | [CallByUrlOptions](#callbyurloptions)<RequestData> |

**Returns:** `Promise<[CallByUrlResult](#callbyurlresult)<ResponseData>>`

**Since:** 6.1.0

---

### useEmulator(...)[¶](#useemulator "Permanent link")

`[](#%5F%5Fcodelineno-7-1)useEmulator(options: UseEmulatorOptions) => Promise<void>
`

Instrument your app to talk to the Cloud Functions emulator.

On Android, the cleartext traffic must be allowed. On the Capacitor configuration:

`[](#%5F%5Fcodelineno-8-1){
[](#%5F%5Fcodelineno-8-2)  server: {
[](#%5F%5Fcodelineno-8-3)    cleartext: true
[](#%5F%5Fcodelineno-8-4)  }
[](#%5F%5Fcodelineno-8-5)}
`

**The cleartext traffic is not intended for use in production.** 

| Param       | Type                                      |
| ----------- | ----------------------------------------- |
| **options** | [UseEmulatorOptions](#useemulatoroptions) |

**Since:** 6.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### CallResult[¶](#callresult "Permanent link")

| Prop     | Type         | Description                          | Since |
| -------- | ------------ | ------------------------------------ | ----- |
| **data** | ResponseData | The result of the callable function. | 6.1.0 |

#### CallByNameOptions[¶](#callbynameoptions "Permanent link")

| Prop       | Type   | Description                          | Since |
| ---------- | ------ | ------------------------------------ | ----- |
| **name**   | string | The name of the callable function.   | 6.1.0 |
| **region** | string | The region of the callable function. | 6.1.0 |

#### CallByUrlOptions[¶](#callbyurloptions "Permanent link")

| Prop    | Type   | Description                       | Since |
| ------- | ------ | --------------------------------- | ----- |
| **url** | string | The URL of the callable function. | 6.1.0 |

#### UseEmulatorOptions[¶](#useemulatoroptions "Permanent link")

| Prop                     | Type   | Description                                                                                                                                                                     | Default | Since |
| ------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----- |
| **host**                 | string | The emulator host without any port or scheme. Note when using a Android Emulator device: 10.0.2.2 is the special IP address to connect to the 'localhost' of the host computer. | 6.1.0   |       |
| **port**                 | number | The emulator port.                                                                                                                                                              | 5001    | 6.1.0 |
| **regionOrCustomDomain** | string | The region the callable functions are located in or a custom domain hosting the callable functions.                                                                             |         |       |

### Type Aliases[¶](#type-aliases "Permanent link")

#### CallByNameResult[¶](#callbynameresult "Permanent link")

`[CallResult](#callresult)<ResponseData>`

#### CallByUrlResult[¶](#callbyurlresult "Permanent link")

`[CallResult](#callresult)<ResponseData>`

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/functions/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/functions/LICENSE).

---

1. This project is not affiliated with, endorsed by, sponsored by, or approved by Google LLC or any of their affiliates or subsidiaries. [↩](#fnref:1 "Jump back to footnote 1 in the text")

May 21, 2026 

 Back to top 