Index of every page on this site: llms.txt
All skills
firebase avatar

/firebase-crashlytics

@99954a3 official
by firebasefirebase/agent-skills520 stars
116
Run it yourself

Comprehensive guide for Firebase Crashlytics, including provisioning and SDK usage. Use this skill when the user needs help setting up Crashlytics, adding crash reporting, or using the Crashlytics SDK in their application.

Use this Skill: https://skilld.dev/gh/firebase/agent-skills/firebase-crashlytics

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesweb_setup.md

≈2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Firebase Crashlytics - Web Setup Guide

This guide details the setup and configuration of Firebase Crashlytics for web applications.

Important references:

  • Refer to skills/firebase-basics/references/web_setup.md for project creation, registering a web app, and initializing the core Firebase app.
  • Refer to the Get started with Firebase Crashlytics for Web guide for detailed configuration, architecture, and framework documentation.

Prerequisites

  • Ensure the Firebase project and web app are set up (see skills/firebase-basics/references/web_setup.md).
  • Firebase CLI: Requires version v15.35.0 or later, authenticated (firebase login), and project set (firebase use <PROJECT_ID>).
  • Permissions & Billing: Cloud project Owner or Editor role and Blaze (pay-as-you-go) billing enabled.

1. Configure Firebase / Cloud Project

Web Crashlytics leverages Cloud Logging and Cloud Storage under the hood. Use the Firebase CLI to onboard your project and web app:

npx -y firebase-tools@latest crashlytics:setup <YOUR_FIREBASE_APP_ID> --project <YOUR_FIREBASE_PROJECT_ID>

This automated command enables the required Telemetry APIs, provisions the Cloud Logging bucket with Log Analytics enabled, configures routing sinks, and sets up alerts.


2. Install Packages & Initialize SDK

Install the Firebase package:

npm install firebase

3. Framework-Specific Setup Guides

Refer to the framework-specific guide corresponding to your app:

  • Next.js Setup Guide: Wrap <CrashlyticsRoutes> from firebase/crashlytics/next-navigation inside a Client Component ("use client"), then wrap your root App Router layout.
  • React Setup Guide: Wrap root application components with <FirebaseCrashlytics> from firebase/crashlytics/react.
  • React Router Setup Guide: Replace React Router's <Routes> container with <CrashlyticsRoutes> from firebase/crashlytics/react-router for parameterized path tracking.
  • TanStack Router Setup Guide: Initialize with getCrashlytics(app) and bind error logging in defaultOnCatch using recordError().
  • Angular Setup Guide: Add provideCrashlytics(() => app) from firebase/crashlytics/angular to application providers in app.config.ts.

4. Stack Trace De-obfuscation (Source Map Uploading)

To display de-minified stack traces in the Crashlytics console, upload production source maps using the Firebase CLI:

npx -y firebase-tools@latest crashlytics:sourcemap:upload \
  --project <YOUR_FIREBASE_PROJECT_ID> \
  --app <YOUR_FIREBASE_APP_ID> \
  --debug <BUILD_OUTPUT_DIRECTORY>

[!CAUTION] Ensure .map files are deleted or are not publicly accessible in your hosted app to avoid leaking source code.

Pass --clean flag to remove local source maps after uploading.

Reference: Get readable crash reports (Web).


5. Force a Test Crash & Verify

  1. Add an on-demand crash trigger inside a user action handler (e.g., a button click):
    <button onClick={() => { throw new Error("Test Crash"); }}>Trigger Test Crash</button>
  2. Trigger the crash in the running web application.
  3. Verify in the Firebase Console:
    • Navigate to https://console.firebase.google.com/u/0/project/<YOUR_FIREBASE_PROJECT_ID>/crashlytics/app/web:<YOUR_FIREBASE_APP_ID>/issues
    • Alternatively, verify using the get_report tool if the Firebase MCP server is installed.
  4. Remove the test crash code once verified.

Reference: Test your implementation (Web).


6. Debugging with AI Agents

AI coding agents can assist with investigating web crashes:


7. Additional Configuration & References

Consult the official Crashlytics documentation for advanced configurations:

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning10d3 checks · Risk SAFE
  • Gen Agent Trust Hub11d

    The skill provides a legitimate guide for setting up Firebase Crashlytics on Android, iOS, and Web. It uses official tools and repositories from Google and Firebase.

  • Socket10d

    No alerts

  • Snyk11d

    Risk: MEDIUM · 1 issue

Signed by skilld at 99954a3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago
metadata
{
  "author": "Google LLC",
  "category": "CloudObservabilityAndMonitoring"
}
Other metadata
compatibility
This skill is best used with the Firebase CLI, but does not require it. Firebase CLI can be accessed through `npx -y firebase-tools@latest`.

README badge

README badge for firebase/agent-skills/firebase-crashlytics