Event Processors

With eventProcessors you can hook into the process of enriching the event with additional data. You can add your own eventProcessor on the current scope. The difference between beforeSend and eventProcessors is that eventProcessors run on the scope level whereas beforeSend runs globally, no matter which scope you're in. Also, eventProcessors optionally receive the hint (see: hints).

Copied
// This will be set globally for every succeeding event send
Sentry.configureScope(function(scope) {
  scope.addEventProcessor(function(event, hint) {
    // Add anything to the event here
    // returning null will drop the event
    return event;
  });
});

// Using withScope, will only call the event processor for all "sends"
// that happen within withScope
Sentry.withScope(function(scope) {
  scope.addEventProcessor(function(event, hint) {
    // Add anything to the event here
    // returning null will drop the event
    return event;
  });
  Sentry.captureMessage("Test");
});
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").