Google is committed to advancing racial equity for Black communities. See how.

Firebase Crashlytics triggers

You can trigger a function in response to Crashlytics issue events including new issues, regressed issues, and velocity alerts.

Trigger a Crashlytics function

To trigger a Crashlytics function, first generate an IssueBuilder with functions.crashlytics.issue(), then call the builder's appropriate issue-generation function:


New issue events trigger when your app experiences an issue for the first time.

exports.sendOnNewIssue = functions.crashlytics.issue().onNew(async (issue) => {
  // ...

Regressed issue events trigger when an issue reoccurs after it's closed in Crashlytics. Example:

exports.sendOnRegressedIssue = functions.crashlytics.issue().onRegressed(async (issue) => {
  // ...

Velocity alert events trigger when a statistically significant number of sessions in a given build crash. Example:

exports.sendOnVelocityAlert = functions.crashlytics.issue().onVelocityAlert(async (issue) => {
  // ...

Access event attributes

Each event triger created with IssueBuilder returns an Issue with properties that include the issue's name, ID, relevant app info, and more.

For example, when your app experiences a new issue, you could send a message to Slack with the issue's ID and title:

exports.postOnNewIssue = functions.crashlytics.issue().onNew(async (issue) => {
  const issueId = issue.issueId;
  const issueTitle = issue.issueTitle;
  const appName = issue.appInfo.appName;
  const appPlatform = issue.appInfo.appPlatform;
  const latestAppVersion = issue.appInfo.latestAppVersion;

  const slackMessage = `<!here|here> There is a new issue - ${issueTitle} (${issueId}) ` +
      `in ${appName}, version ${latestAppVersion} on ${appPlatform}`;

  await notifySlack(slackMessage);
  console.log(`Posted new issue ${issueId} successfully to Slack`);