Flare Error tracking made for Laravel
Features Pricing Docs Blog Log in Start free trial Free trial
  • Docs
  • Videos

Documentation

  • General

    • Welcome
    • Projects
    • Errors
    • Error occurrences
    • Using the API
    • Sharing error occurrences
    • Spike protection
    • GitHub integration
  • Ignition for Laravel

    • Installation
    • Configuration
    • Security
    • Controlling collected data
    • Sending logs to Flare
    • Linking to errors
    • Identifying users
    • Adding custom context
    • Adding glows
    • Writing custom middleware
  • Flare for generic PHP projects

    • Installation
    • Controlling collected data
    • Identifying users
    • Linking to errors
    • Adding custom context
    • Adding glows
    • Writing custom middleware
  • Javascript error tracking

    • Installation
    • Framework integrations
    • Resolving Bundled Code
    • Reporting errors
    • Client hooks
    • Adding custom context
    • Adding glows
    • Solution Providers
  • Solutions

    • Introduction
    • Adding custom solutions
    • Making solutions runnable
    • Using solution providers
    • Writing good solutions
  • Notifications

    • Configuring notifications
    • Mail
    • Slack
    • Telegram
    • SMS
    • Webhooks
    • Discord
    • Microsoft Teams
  • Team management

    • Using multiple teams
    • Subscribing to a plan
    • Receiving invoices
    • Managing team members
    • Inviting guests to projects

Client hooks

The @flareapp/flare-client provides a couple hooks to help you finetune your integration with Flare.

flare.beforeEvaluate

beforeEvaluate: (error: Error) => Error | false | Promise<Error | false>;

Depending on the size of the report, submitting an error can take a second, and has a chance of slowing down your application. If you want to stop some errors from being evaluated, use the flare.beforeEvaluate function. If you return (a Promise returning) false from that function, Flare won't create or report the passed error:

flare.beforeEvaluate = error => { if (error.message.includes('Boring error')) { return false; } };

flare.beforeSubmit

beforeSubmit: (report: ErrorReport) => ErrorReport | false | Promise<ErrorReport | false>

You can also stop a report from being sent to Flare, or edit it right before it's submitted using the flare.beforeSubmit function:

flare.beforeSubmit = report => { report.stacktrace = []; // remove the stacktrace for all reports return report; }

Using this hook, you can also add additional context to your error report. Read more about customizing the report here.

Previous topic Next topic

About Flare

  • Home
  • Features
  • Pricing
  • Support

Resources

  • Blog
  • Changelog
  • Docs
  • Ignition

App

  • Log in
  • Start free trial
SPATIE
  • Service status
  • Terms of use
  • Privacy & cookie policy