firebase_functions.alerts.crashlytics_fn module

Cloud functions to handle Crashlytics events from Firebase Alerts.

Classes

CrashlyticsEvent

class firebase_functions.alerts.crashlytics_fn.CrashlyticsEvent(specversion: str, id: str, source: str, type: str, time: datetime, data: T, subject: str | None, alert_type: str, app_id: str)

Bases: CloudEvent[FirebaseAlertData[T]]

A custom CloudEvent for billing Firebase Alerts.

alert_type: str

The type of the alerts that got triggered.

app_id: str

The Firebase App ID that's associated with the alert.

Issue

class firebase_functions.alerts.crashlytics_fn.Issue(id: str, title: str, subtitle: str, app_version: str)

Bases: object

Generic Crashlytics issue interface

app_version: str

The application version of the Crashlytics issue

id: str

The ID of the Crashlytics issue

subtitle: str

The subtitle of the Crashlytics issue

title: str

The title of the Crashlytics issue

NewAnrIssuePayload

class firebase_functions.alerts.crashlytics_fn.NewAnrIssuePayload(issue: Issue)

Bases: object

The internal payload object for a new Application Not Responding issue. Payload is wrapped inside a FirebaseAlertData object.

issue: Issue

Basic information of the Crashlytics issue

NewFatalIssuePayload

class firebase_functions.alerts.crashlytics_fn.NewFatalIssuePayload(issue: Issue)

Bases: object

The internal payload object for a new fatal issue. Payload is wrapped inside a FirebaseAlertData object.

issue: Issue

Basic information of the Crashlytics issue

NewNonfatalIssuePayload

class firebase_functions.alerts.crashlytics_fn.NewNonfatalIssuePayload(issue: Issue)

Bases: object

The internal payload object for a new non-fatal issue. Payload is wrapped inside a FirebaseAlertData object.

issue: Issue

Basic information of the Crashlytics issue

RegressionAlertPayload

class firebase_functions.alerts.crashlytics_fn.RegressionAlertPayload(type: str, issue: Issue, resolve_time: datetime)

Bases: object

The internal payload object for a regression alert. Payload is wrapped inside a FirebaseAlertData object.

issue: Issue

Basic information of the Crashlytics issue

resolve_time: datetime

The time that the Crashlytics issues was most recently resolved before it began to reoccur.

type: str

The type of the Crashlytics issue, e.g. new fatal, new nonfatal, ANR

StabilityDigestPayload

class firebase_functions.alerts.crashlytics_fn.StabilityDigestPayload(digest_date: datetime, trending_issues: list[TrendingIssueDetails])

Bases: object

The internal payload object for a stability digest. Payload is wrapped inside a FirebaseAlertData object.

digest_date: datetime

The date that the digest gets created. Issues in the digest should have the same date as the digest date

trending_issues: list[TrendingIssueDetails]

A stability digest containing several trending Crashlytics issues

TrendingIssueDetails

class firebase_functions.alerts.crashlytics_fn.TrendingIssueDetails(type: str, issue: Issue, event_count: int, user_count: int)

Bases: object

Generic Crashlytics trending issue interface

event_count: int

The number of crashes that occurred with the issue

issue: Issue

Basic information of the Crashlytics issue

type: str

The type of the Crashlytics issue, e.g. new fatal, new nonfatal, ANR

user_count: int

The number of distinct users that were affected by the issue

VelocityAlertPayload

class firebase_functions.alerts.crashlytics_fn.VelocityAlertPayload(issue: Issue, create_time: datetime, crash_count: int, crash_percentage: float, first_version: str)

Bases: object

The internal payload object for a velocity alert. Payload is wrapped inside a FirebaseAlertData object.

crash_count: int

The number of user sessions for the given app version that had this specific crash issue in the time period used to trigger the velocity alert.

crash_percentage: float

The percentage of user sessions for the given app version that had this specific crash issue in the time period used to trigger the velocity alert.

create_time: datetime

The time that the Crashlytics issue gets created

first_version: str

The first app version where this issue was seen, and not necessarily the version that has triggered the alert.

issue: Issue

Basic information of the Crashlytics issue

Functions

on_new_anr_issue_published

firebase_functions.alerts.crashlytics_fn.on_new_anr_issue_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[NewAnrIssuePayload]], None]], Callable[[CrashlyticsEvent[NewAnrIssuePayload]], None]]

Event handler which runs every time a new ANR issue is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_new_anr_issue_published()
def example(alert: crashlytics_fn.CrashlyticsNewAnrIssueEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsNewAnrIssueEvent ], None ] A function that takes a CrashlyticsNewAnrIssueEvent and returns None.

on_new_fatal_issue_published

firebase_functions.alerts.crashlytics_fn.on_new_fatal_issue_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[NewFatalIssuePayload]], None]], Callable[[CrashlyticsEvent[NewFatalIssuePayload]], None]]

Event handler which runs every time a new fatal issue is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_new_fatal_issue_published()
def example(alert: crashlytics_fn.CrashlyticsNewFatalIssueEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsNewFatalIssueEvent ], None ] A function that takes a CrashlyticsNewFatalIssueEvent and returns None.

on_new_nonfatal_issue_published

firebase_functions.alerts.crashlytics_fn.on_new_nonfatal_issue_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[NewNonfatalIssuePayload]], None]], Callable[[CrashlyticsEvent[NewNonfatalIssuePayload]], None]]

Event handler which runs every time a new nonfatal issue is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_new_nonfatal_issue_published()
def example(alert: crashlytics_fn.CrashlyticsNewNonfatalIssueEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsNewNonfatalIssueEvent ], None ] A function that takes a CrashlyticsNewNonfatalIssueEvent and returns None.

on_regression_alert_published

firebase_functions.alerts.crashlytics_fn.on_regression_alert_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[RegressionAlertPayload]], None]], Callable[[CrashlyticsEvent[RegressionAlertPayload]], None]]

Event handler which runs every time a regression alert is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_regression_alert_published()
def example(alert: crashlytics_fn.CrashlyticsRegressionAlertEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsRegressionAlertEvent ], None ] A function that takes a CrashlyticsRegressionAlertEvent and returns None.

on_stability_digest_published

firebase_functions.alerts.crashlytics_fn.on_stability_digest_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[StabilityDigestPayload]], None]], Callable[[CrashlyticsEvent[StabilityDigestPayload]], None]]

Event handler which runs every time a stability digest is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_stability_digest_published()
def example(alert: crashlytics_fn.CrashlyticsStabilityDigestEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsStabilityDigestEvent ], None ] A function that takes a CrashlyticsStabilityDigestEvent and returns None.

on_velocity_alert_published

firebase_functions.alerts.crashlytics_fn.on_velocity_alert_published(**kwargs) Callable[[Callable[[CrashlyticsEvent[VelocityAlertPayload]], None]], Callable[[CrashlyticsEvent[VelocityAlertPayload]], None]]

Event handler which runs every time a velocity alert is received.

Example:

import firebase_functions.alerts.crashlytics_fn as crashlytics_fn

@crashlytics_fn.on_velocity_alert_published()
def example(alert: crashlytics_fn.CrashlyticsVelocityAlertEvent) -> None:
    print(alert)
Parameters:

**kwargs (as firebase_functions.options.CrashlyticsOptions) -- Options.

Return type:

typing.Callable [ [ firebase_functions.alerts.crashlytics_fn.CrashlyticsVelocityAlertEvent ], None ] A function that takes a CrashlyticsVelocityAlertEvent and returns None.

Constants

CrashlyticsNewAnrIssueEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsNewAnrIssueEvent

The type of the event for 'on_new_anr_issue_published' functions.

alias of CrashlyticsEvent[NewAnrIssuePayload]

CrashlyticsNewFatalIssueEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsNewFatalIssueEvent

The type of the event for 'on_new_fatal_issue_published' functions.

alias of CrashlyticsEvent[NewFatalIssuePayload]

CrashlyticsNewNonfatalIssueEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsNewNonfatalIssueEvent

The type of the event for 'on_new_nonfatal_issue_published' functions.

alias of CrashlyticsEvent[NewNonfatalIssuePayload]

CrashlyticsRegressionAlertEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsRegressionAlertEvent

The type of the event for 'on_regression_alert_published' functions.

alias of CrashlyticsEvent[RegressionAlertPayload]

CrashlyticsStabilityDigestEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsStabilityDigestEvent

The type of the event for 'on_stability_digest_published' functions.

alias of CrashlyticsEvent[StabilityDigestPayload]

CrashlyticsVelocityAlertEvent

firebase_functions.alerts.crashlytics_fn.CrashlyticsVelocityAlertEvent

The type of the event for 'on_velocity_alert_published' functions.

alias of CrashlyticsEvent[VelocityAlertPayload]

OnNewAnrIssuePublishedCallable

firebase_functions.alerts.crashlytics_fn.OnNewAnrIssuePublishedCallable

The type of the callable for 'on_new_anr_issue_published' functions.

alias of Callable[[CrashlyticsEvent[NewAnrIssuePayload]], None]

OnNewFatalIssuePublishedCallable

firebase_functions.alerts.crashlytics_fn.OnNewFatalIssuePublishedCallable

The type of the callable for 'on_new_fatal_issue_published' functions.

alias of Callable[[CrashlyticsEvent[NewFatalIssuePayload]], None]

OnNewNonfatalIssuePublishedCallable

firebase_functions.alerts.crashlytics_fn.OnNewNonfatalIssuePublishedCallable

The type of the callable for 'on_new_nonfatal_issue_published' functions.

alias of Callable[[CrashlyticsEvent[NewNonfatalIssuePayload]], None]

OnRegressionAlertPublishedCallable

firebase_functions.alerts.crashlytics_fn.OnRegressionAlertPublishedCallable

The type of the callable for 'on_regression_alert_published' functions.

alias of Callable[[CrashlyticsEvent[RegressionAlertPayload]], None]

OnStabilityDigestPublishedCallable

firebase_functions.alerts.crashlytics_fn.OnStabilityDigestPublishedCallable

The type of the callable for 'on_stability_digest_published' functions.

alias of Callable[[CrashlyticsEvent[StabilityDigestPayload]], None]

OnVelocityAlertPublishedCallable

firebase_functions.alerts.crashlytics_fn.OnVelocityAlertPublishedCallable

The type of the callable for 'on_velocity_alert_published' functions.

alias of Callable[[CrashlyticsEvent[VelocityAlertPayload]], None]