CrashlyticsOptions interface

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Options for initializing the Crashlytics service using getCrashlytics().

Signature:

export interface CrashlyticsOptions 

Properties

Property Type Description
appVersion string (Public Preview) The version of the application. This should be a unique string that identifies the snapshot of code to be deployed, such as "1.0.2". If not specified, other default locations will be checked for an identifier. Setting a value here takes precedence over any other values.
captureUnhandledErrors boolean (Public Preview) Automatically capture uncaught browser exceptions ('error' and 'unhandledrejection' window events).Defaults to true.
customAttributes AnyValueMap (Public Preview) Base set of custom attributes to send with automatic error collection. Key-value pairs defined here will be sent with all error logs. If custom attributes are also specified in recordError() or log(), those values will take precedence over the base set defined here.
endpointUrl string (Public Preview) The URL for the endpoint to which Crashlytics data should be sent, in the OpenTelemetry format. By default, data will be sent to Firebase.
features CrashlyticsFeature[] (EXPERIMENTAL) Optional list of Crashlytics features (such as breadcrumbs()) to enable.When breadcrumbs() is included, Crashlytics collects OpenTelemetry spans (such as Fetch, XMLHttpRequest, and Document Load) and breadcrumb logs (such as navigation events, Web Vitals, user actions, and visibility lifecycle events), buffering them in memory and exporting them when an error occurs.
region string (Public Preview) The Google Cloud region where the Crashlytics data should be sent.By default, data will be sent to the "global" region.Refer to https://cloud.google.com/logging/docs/regions for the list of available regions.
registerGlobalLoggerProvider boolean (Public Preview) Whether to register the underlying OpenTelemetry LoggerProvider globally with the OpenTelemetry API (logs.setGlobalLoggerProvider()).When enabled, other OpenTelemetry instrumentations (such as Core Web Vitals, Console, or Fetch) and custom application loggers can automatically route logs through Firebase Crashlytics.Defaults to false.

CrashlyticsOptions.appVersion

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The version of the application. This should be a unique string that identifies the snapshot of code to be deployed, such as "1.0.2". If not specified, other default locations will be checked for an identifier. Setting a value here takes precedence over any other values.

Signature:

appVersion?: string;

CrashlyticsOptions.captureUnhandledErrors

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Automatically capture uncaught browser exceptions ('error' and 'unhandledrejection' window events).

Defaults to true.

Signature:

captureUnhandledErrors?: boolean;

CrashlyticsOptions.customAttributes

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Base set of custom attributes to send with automatic error collection. Key-value pairs defined here will be sent with all error logs. If custom attributes are also specified in recordError() or log(), those values will take precedence over the base set defined here.

Signature:

customAttributes?: AnyValueMap;

CrashlyticsOptions.endpointUrl

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The URL for the endpoint to which Crashlytics data should be sent, in the OpenTelemetry format. By default, data will be sent to Firebase.

Signature:

endpointUrl?: string;

CrashlyticsOptions.features

(EXPERIMENTAL) Optional list of Crashlytics features (such as breadcrumbs()) to enable.

When breadcrumbs() is included, Crashlytics collects OpenTelemetry spans (such as Fetch, XMLHttpRequest, and Document Load) and breadcrumb logs (such as navigation events, Web Vitals, user actions, and visibility lifecycle events), buffering them in memory and exporting them when an error occurs.

Signature:

features?: CrashlyticsFeature[];

Example

import { getCrashlytics, breadcrumbs } from 'firebase/crashlytics';

const crashlytics = getCrashlytics(app, {
  features: [breadcrumbs()]
});

CrashlyticsOptions.region

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The Google Cloud region where the Crashlytics data should be sent.

By default, data will be sent to the "global" region.

Refer to https://cloud.google.com/logging/docs/regions for the list of available regions.

Signature:

region?: string;

CrashlyticsOptions.registerGlobalLoggerProvider

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Whether to register the underlying OpenTelemetry LoggerProvider globally with the OpenTelemetry API (logs.setGlobalLoggerProvider()).

When enabled, other OpenTelemetry instrumentations (such as Core Web Vitals, Console, or Fetch) and custom application loggers can automatically route logs through Firebase Crashlytics.

Defaults to false.

Signature:

registerGlobalLoggerProvider?: boolean;