Add an optional middleware callback to alter data before sending to Sentry