---
description: Unofficial Capacitor plugin for Firebase Performance Monitoring SDK to measure app performance and identify bottlenecks.
title: Capacitor Firebase Performance Plugin - Capawesome
image: https://capawesome.io/docs/assets/images/social/sdks/capacitor/firebase/performance-monitoring.png
---

[ Skip to content](#capacitor-firebaseperformance) 

[ 🔐 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)
* [  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/performance[¶](#capacitor-firebaseperformance "Permanent link")

Unofficial Capacitor plugin for [Firebase Performance Monitoring](https://firebase.google.com/docs/perf-mon).[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     |
| 6.x.x          | 6.x.x             | Deprecated     |
| 5.x.x          | 5.x.x             | Deprecated     |
| 1.x.x          | 4.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/performance` 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/performance firebase
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

Add Firebase to your project if you haven't already ([Android](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#android) / [iOS](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#ios) / [Web](https://github.com/capawesome-team/capacitor-firebase/blob/main/docs/firebase-setup.md#web)).

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

See [Add the Performance Monitoring plugin to your app](https://firebase.google.com/docs/perf-mon/get-started-android#add-perfmon-plugin) and follow the instructions to set up your app correctly.

#### 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:

* `$firebasePerfVersion` version of `com.google.firebase:firebase-perf` (default: `22.0.4`)

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/performance": {
[](#%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 { FirebasePerformance } from '@capacitor-firebase/performance';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const startTrace = async () => {
[](#%5F%5Fcodelineno-4-4)  await FirebasePerformance.startTrace({ traceName: 'test_trace' });
[](#%5F%5Fcodelineno-4-5)};
[](#%5F%5Fcodelineno-4-6)
[](#%5F%5Fcodelineno-4-7)const stopTrace = async () => {
[](#%5F%5Fcodelineno-4-8)  await FirebasePerformance.stopTrace({ traceName: 'test_trace' });
[](#%5F%5Fcodelineno-4-9)};
[](#%5F%5Fcodelineno-4-10)
[](#%5F%5Fcodelineno-4-11)const incrementMetric = async () => {
[](#%5F%5Fcodelineno-4-12)  await FirebasePerformance.incrementMetric({
[](#%5F%5Fcodelineno-4-13)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-14)    metricName: 'item_cache_hit',
[](#%5F%5Fcodelineno-4-15)    incrementBy: 1,
[](#%5F%5Fcodelineno-4-16)  });
[](#%5F%5Fcodelineno-4-17)};
[](#%5F%5Fcodelineno-4-18)
[](#%5F%5Fcodelineno-4-19)const setEnabled = async () => {
[](#%5F%5Fcodelineno-4-20)  await FirebasePerformance.setEnabled({ enabled: true });
[](#%5F%5Fcodelineno-4-21)};
[](#%5F%5Fcodelineno-4-22)
[](#%5F%5Fcodelineno-4-23)const isEnabled = async () => {
[](#%5F%5Fcodelineno-4-24)  const result = await FirebasePerformance.isEnabled();
[](#%5F%5Fcodelineno-4-25)  return result.enabled;
[](#%5F%5Fcodelineno-4-26)};
[](#%5F%5Fcodelineno-4-27)
[](#%5F%5Fcodelineno-4-28)const putAttribute = async () => {
[](#%5F%5Fcodelineno-4-29)  await FirebasePerformance.putAttribute({
[](#%5F%5Fcodelineno-4-30)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-31)    attribute: 'user_id',
[](#%5F%5Fcodelineno-4-32)    value: '123',
[](#%5F%5Fcodelineno-4-33)  });
[](#%5F%5Fcodelineno-4-34)};
[](#%5F%5Fcodelineno-4-35)
[](#%5F%5Fcodelineno-4-36)const getAttribute = async () => {
[](#%5F%5Fcodelineno-4-37)  const result = await FirebasePerformance.getAttribute({
[](#%5F%5Fcodelineno-4-38)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-39)    attribute: 'user_id',
[](#%5F%5Fcodelineno-4-40)  });
[](#%5F%5Fcodelineno-4-41)  return result.attributes;
[](#%5F%5Fcodelineno-4-42)};
[](#%5F%5Fcodelineno-4-43)
[](#%5F%5Fcodelineno-4-44)const getAttributes = async () => {
[](#%5F%5Fcodelineno-4-45)  const result = await FirebasePerformance.getAttributes({ traceName: 'test_trace' });
[](#%5F%5Fcodelineno-4-46)  return result.attributes;
[](#%5F%5Fcodelineno-4-47)};
[](#%5F%5Fcodelineno-4-48)
[](#%5F%5Fcodelineno-4-49)const removeAttribute = async () => {
[](#%5F%5Fcodelineno-4-50)  await FirebasePerformance.removeAttribute({
[](#%5F%5Fcodelineno-4-51)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-52)    attribute: 'user_id',
[](#%5F%5Fcodelineno-4-53)  });
[](#%5F%5Fcodelineno-4-54)};
[](#%5F%5Fcodelineno-4-55)
[](#%5F%5Fcodelineno-4-56)const putMetric = async () => {
[](#%5F%5Fcodelineno-4-57)  await FirebasePerformance.putMetric({
[](#%5F%5Fcodelineno-4-58)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-59)    metricName: 'item_cache_hit',
[](#%5F%5Fcodelineno-4-60)    num: 1,
[](#%5F%5Fcodelineno-4-61)  });
[](#%5F%5Fcodelineno-4-62)};
[](#%5F%5Fcodelineno-4-63)
[](#%5F%5Fcodelineno-4-64)const getMetric = async () => {
[](#%5F%5Fcodelineno-4-65)  const result = await FirebasePerformance.getMetric({
[](#%5F%5Fcodelineno-4-66)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-67)    metricName: 'item_cache_hit',
[](#%5F%5Fcodelineno-4-68)  });
[](#%5F%5Fcodelineno-4-69)  return result.value;
[](#%5F%5Fcodelineno-4-70)};
[](#%5F%5Fcodelineno-4-71)
[](#%5F%5Fcodelineno-4-72)const record = async () => {
[](#%5F%5Fcodelineno-4-73)  await FirebasePerformance.record({
[](#%5F%5Fcodelineno-4-74)    traceName: 'test_trace',
[](#%5F%5Fcodelineno-4-75)    startTime: Date.now(),
[](#%5F%5Fcodelineno-4-76)    duration: 1000,
[](#%5F%5Fcodelineno-4-77)    options: {
[](#%5F%5Fcodelineno-4-78)      metrics: {
[](#%5F%5Fcodelineno-4-79)        item_cache_hit: 1,
[](#%5F%5Fcodelineno-4-80)      },
[](#%5F%5Fcodelineno-4-81)      attributes: {
[](#%5F%5Fcodelineno-4-82)        user_id: '123',
[](#%5F%5Fcodelineno-4-83)      },
[](#%5F%5Fcodelineno-4-84)    },
[](#%5F%5Fcodelineno-4-85)  });
[](#%5F%5Fcodelineno-4-86)};
`

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

* [startTrace(...)](#starttrace)
* [stopTrace(...)](#stoptrace)
* [incrementMetric(...)](#incrementmetric)
* [setEnabled(...)](#setenabled)
* [isEnabled()](#isenabled)
* [putAttribute(...)](#putattribute)
* [getAttribute(...)](#getattribute)
* [getAttributes(...)](#getattributes)
* [removeAttribute(...)](#removeattribute)
* [putMetric(...)](#putmetric)
* [getMetric(...)](#getmetric)
* [record(...)](#record)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### startTrace(...)[¶](#starttrace "Permanent link")

`[](#%5F%5Fcodelineno-5-1)startTrace(options: StartTraceOptions) => Promise<void>
`

Starts a trace.

| Param       | Type                                    |
| ----------- | --------------------------------------- |
| **options** | [StartTraceOptions](#starttraceoptions) |

**Since:** 0.1.0

---

### stopTrace(...)[¶](#stoptrace "Permanent link")

`[](#%5F%5Fcodelineno-6-1)stopTrace(options: StopTraceOptions) => Promise<void>
`

Stops a trace.

| Param       | Type                                  |
| ----------- | ------------------------------------- |
| **options** | [StopTraceOptions](#stoptraceoptions) |

**Since:** 0.1.0

---

### incrementMetric(...)[¶](#incrementmetric "Permanent link")

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

Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.

| Param       | Type                                              |
| ----------- | ------------------------------------------------- |
| **options** | [IncrementMetricOptions](#incrementmetricoptions) |

**Since:** 0.1.0

---

### setEnabled(...)[¶](#setenabled "Permanent link")

`[](#%5F%5Fcodelineno-8-1)setEnabled(options: SetEnabledOptions) => Promise<void>
`

Enables or disables performance monitoring. Will be applied with the next start of the app.

| Param       | Type                                    |
| ----------- | --------------------------------------- |
| **options** | [SetEnabledOptions](#setenabledoptions) |

**Since:** 0.1.0

---

### isEnabled()[¶](#isenabled "Permanent link")

`[](#%5F%5Fcodelineno-9-1)isEnabled() => Promise<IsEnabledResult>
`

Determines whether performance monitoring is enabled or disabled.

**Returns:** `Promise<[IsEnabledResult](#isenabledresult)>`

**Since:** 0.1.0

---

### putAttribute(...)[¶](#putattribute "Permanent link")

`[](#%5F%5Fcodelineno-10-1)putAttribute(options: PutAttributeOptions) => Promise<void>
`

Sets a custom attribute of a trace to a given value.

| Param       | Type                                        |
| ----------- | ------------------------------------------- |
| **options** | [PutAttributeOptions](#putattributeoptions) |

**Since:** 6.3.0

---

### getAttribute(...)[¶](#getattribute "Permanent link")

`[](#%5F%5Fcodelineno-11-1)getAttribute(options: GetAttributeOptions) => Promise<GetAttributeResult>
`

Returns the value of a custom attribute of a trace.

| Param       | Type                                        |
| ----------- | ------------------------------------------- |
| **options** | [GetAttributeOptions](#getattributeoptions) |

**Returns:** `Promise<[GetAttributeResult](#getattributeresult)>`

**Since:** 6.3.0

---

### getAttributes(...)[¶](#getattributes "Permanent link")

`[](#%5F%5Fcodelineno-12-1)getAttributes(options: GetAttributesOptions) => Promise<GetAttributesResult>
`

Gets the all the custom attributes of a trace with their values.

| Param       | Type                                          |
| ----------- | --------------------------------------------- |
| **options** | [GetAttributesOptions](#getattributesoptions) |

**Returns:** `Promise<[GetAttributesResult](#getattributesresult)>`

**Since:** 6.3.0

---

### removeAttribute(...)[¶](#removeattribute "Permanent link")

`[](#%5F%5Fcodelineno-13-1)removeAttribute(options: RemoveAttributeOptions) => Promise<void>
`

Removes a custom attribute from a trace given its name.

| Param       | Type                                        |
| ----------- | ------------------------------------------- |
| **options** | [GetAttributeOptions](#getattributeoptions) |

**Since:** 6.3.0

---

### putMetric(...)[¶](#putmetric "Permanent link")

`[](#%5F%5Fcodelineno-14-1)putMetric(options: PutMetricOptions) => Promise<void>
`

Sets the value of a custom metric.

| Param       | Type                                  |
| ----------- | ------------------------------------- |
| **options** | [PutMetricOptions](#putmetricoptions) |

**Since:** 6.3.0

---

### getMetric(...)[¶](#getmetric "Permanent link")

`[](#%5F%5Fcodelineno-15-1)getMetric(options: GetMetricOptions) => Promise<GetMetricResult>
`

Get the value of a custom metric by name.

| Param       | Type                                  |
| ----------- | ------------------------------------- |
| **options** | [GetMetricOptions](#getmetricoptions) |

**Returns:** `Promise<[GetMetricResult](#getmetricresult)>`

**Since:** 6.3.0

---

### record(...)[¶](#record "Permanent link")

`[](#%5F%5Fcodelineno-16-1)record(options: RecordOptions) => Promise<void>
`

Records a trace given its name and options.

Only available on web.

| Param       | Type                            |
| ----------- | ------------------------------- |
| **options** | [RecordOptions](#recordoptions) |

**Since:** 6.3.0

---

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

#### StartTraceOptions[¶](#starttraceoptions "Permanent link")

| Prop          | Type   | Description                                                                                                                                                                                      | Since |
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- |
| **traceName** | string | Custom trace name. Names for custom code traces must meet the following requirements: no leading or trailing whitespace, no leading underscore (\_) character, and max length is 100 characters. | 0.1.0 |

#### StopTraceOptions[¶](#stoptraceoptions "Permanent link")

| Prop          | Type   | Description                                     | Since |
| ------------- | ------ | ----------------------------------------------- | ----- |
| **traceName** | string | Name of the trace that was set with startTrace. | 0.1.0 |

#### IncrementMetricOptions[¶](#incrementmetricoptions "Permanent link")

| Prop            | Type   | Description                                       | Default | Since |
| --------------- | ------ | ------------------------------------------------- | ------- | ----- |
| **traceName**   | string | Name of the trace that was set with startTrace.   | 0.1.0   |       |
| **metricName**  | string | Name of the metric to be incremented.             | 0.1.0   |       |
| **incrementBy** | number | Amount by which the metric has to be incremented. | 1       | 0.1.0 |

#### SetEnabledOptions[¶](#setenabledoptions "Permanent link")

| Prop        | Type    | Description                               | Since |
| ----------- | ------- | ----------------------------------------- | ----- |
| **enabled** | boolean | Should performance monitoring be enabled. | 0.1.0 |

#### IsEnabledResult[¶](#isenabledresult "Permanent link")

| Prop        | Type    | Description                                                 | Since |
| ----------- | ------- | ----------------------------------------------------------- | ----- |
| **enabled** | boolean | true if performance monitoring is enabled, otherwise false. | 0.1.0 |

#### PutAttributeOptions[¶](#putattributeoptions "Permanent link")

| Prop          | Type   | Description                             | Since |
| ------------- | ------ | --------------------------------------- | ----- |
| **traceName** | string | Name of the trace to set its attribute. | 6.3.0 |
| **attribute** | string | Name of the attribute to set its value. | 6.3.0 |
| **value**     | string | The value to set to the attribute.      | 6.3.0 |

#### GetAttributeResult[¶](#getattributeresult "Permanent link")

| Prop      | Type           | Description                        | Since |
| --------- | -------------- | ---------------------------------- | ----- |
| **value** | string \| null | The value of the custom attribute. | 6.3.0 |

#### GetAttributeOptions[¶](#getattributeoptions "Permanent link")

| Prop          | Type   | Description                                  | Since |
| ------------- | ------ | -------------------------------------------- | ----- |
| **traceName** | string | Name of the trace to set its attribute.      | 6.3.0 |
| **attribute** | string | Name of the attribute to retrieve its value. | 6.3.0 |

#### GetAttributesResult[¶](#getattributesresult "Permanent link")

| Prop           | Type                         | Description                                                  | Since |
| -------------- | ---------------------------- | ------------------------------------------------------------ | ----- |
| **attributes** | { \[key: string\]: string; } | A map of all custom attributes of a trace with their values. | 6.3.0 |

#### GetAttributesOptions[¶](#getattributesoptions "Permanent link")

| Prop          | Type   | Description                              | Since |
| ------------- | ------ | ---------------------------------------- | ----- |
| **traceName** | string | Name of the trace to get its attributes. | 6.3.0 |

#### PutMetricOptions[¶](#putmetricoptions "Permanent link")

| Prop           | Type   | Description                                                                              | Since |
| -------------- | ------ | ---------------------------------------------------------------------------------------- | ----- |
| **traceName**  | string | Name of the trace to set its metric.                                                     | 6.3.0 |
| **metricName** | string | The metric name.                                                                         | 6.3.0 |
| **num**        | number | The value to set for the metric. The given value is floored down to the nearest integer. | 6.3.0 |

#### GetMetricResult[¶](#getmetricresult "Permanent link")

| Prop      | Type   | Description                        | Since |
| --------- | ------ | ---------------------------------- | ----- |
| **value** | number | The value of the metric if exists. | 6.3.0 |

#### GetMetricOptions[¶](#getmetricoptions "Permanent link")

| Prop           | Type   | Description                          | Since |
| -------------- | ------ | ------------------------------------ | ----- |
| **traceName**  | string | Name of the trace to get its metric. | 6.3.0 |
| **metricName** | string | The metric name.                     | 6.3.0 |

#### RecordOptions[¶](#recordoptions "Permanent link")

| Prop          | Type                                                                                   | Description                                                                   | Since |
| ------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----- |
| **traceName** | string                                                                                 | Name of the trace to record.                                                  | 6.3.0 |
| **startTime** | number                                                                                 | Start time of the trace since epoch in milliseconds.                          | 6.3.0 |
| **duration**  | number                                                                                 | The duration of the trace in milliseconds.                                    | 6.3.0 |
| **options**   | { metrics?: { \[key: string\]: number; }; attributes?: { \[key: string\]: string; }; } | An optional object that holds optional maps of custom metrics and attributes. | 6.3.0 |

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

#### RemoveAttributeOptions[¶](#removeattributeoptions "Permanent link")

`[GetAttributeOptions](#getattributeoptions)`

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

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

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

See [LICENSE](https://github.com/capawesome-team/capacitor-firebase/blob/main/packages/performance/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 