Hi. Is there a possibility to have more observabil...
# ask-a-descoper
n
Hi. Is there a possibility to have more observability on errors users are facing (by reporting them to Sentry for example)? As such errors occurs inside the auth flow, they aren't reported to our app.
d
Hi, I'm Descope's AI assistant. I've put together an initial response below based on your question. A member of the support team will take over and follow up shortly. Connector-Based Error Reporting You can use Descope's Generic HTTP Connector to send error data to external services like Sentry. Configure the connector to make HTTP requests to Sentry's API when errors occur in your flows. Custom Error Handling in Flows Within your flows, you can set up custom error handling that captures error details and sends them to your monitoring service: 1. Set error handling to "Continue" instead of "Automatic" in your flow actions. 2. After the error occurs, use a connector to send error data to Sentry. 3. Include dynamic values like error messages, user context, and flow execution details. Client-Side Error Transformation You can also capture errors on the client side using the
errorTransformer
in your React SDK:
Copy code
const errorTransformer = useCallback(
  (error: { text: string; type: string }) => {
    // Send error to Sentry here
    Sentry.captureException(new Error(error.text), {
      tags: { errorType: error.type, source: 'descope-flow' }
    });
    
    return error.text; // Return original or custom message
  },
  []
);
<Descope
  flowId="my-flow-id"
  errorTransformer={errorTransformer}
/>
Audit Trail Integration For comprehensive monitoring, you can also stream audit events (including login failures) to external systems using audit trail streaming connectors. The connector approach within flows gives you the most control over what error data gets sent and when, allowing you to maintain full observability of authentication errors.
n
So for what I understand, we'll have to use "continue" and add this connector to pretty ALL steps inside the auth flow? Isn't there any way to define that globally?
m
There is an observability feature coming up soon, that will help here Looping in @Yaara Tzur @Yosi Haran here
🙏 1