Skip to main content
Back to plugins
@capgo/capacitor-firebase-crashlytics
Tutorial
by github.com/Cap-go

Firebase Crashlytics

Capacitor plugin for Firebase Crashlytics

Guide

Tutorial on Firebase Crashlytics

Using @capgo/capacitor-firebase-crashlytics

Capacitor plugin for Firebase Crashlytics.

Install

bun add @capgo/capacitor-firebase-crashlytics
bunx cap sync

What This Plugin Exposes

  • crash - Forces a crash to test the implementation.
  • setCustomKey - Sets a custom key and value that is associated with subsequent fatal and non-fatal reports.
  • setUserId - Sets a user ID (identifier) that is associated with subsequent fatal and non-fatal reports.
  • log - Adds a custom log message that is sent with your crash data to give yourself more context for the events leading up to a crash.

Example Usage

crash

Forces a crash to test the implementation.

import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';

await FirebaseCrashlytics.crash({} as CrashOptions);

setCustomKey

Sets a custom key and value that is associated with subsequent fatal and non-fatal reports.

import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';

await FirebaseCrashlytics.setCustomKey({} as SetCustomKeyOptions);

setUserId

Sets a user ID (identifier) that is associated with subsequent fatal and non-fatal reports.

import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';

await FirebaseCrashlytics.setUserId({} as SetUserIdOptions);

log

Adds a custom log message that is sent with your crash data to give yourself more context for the events leading up to a crash.

import { FirebaseCrashlytics } from '@capgo/capacitor-firebase-crashlytics';

await FirebaseCrashlytics.log({} as LogOptions);

Full Reference

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

If you are using Using @capgo/capacitor-firebase-crashlytics 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.