Skip to content

Conversation

@toddhgardner
Copy link
Member

@toddhgardner toddhgardner commented Aug 18, 2025

The agent now allows you to add handlers for errors or telemetry. This allows the user or wrapping agents to manipulate things to add more data or prevent something from being sent.

TrackJS.onError((payload) => {
  return payload.entry !== "network"; // ignore all network errors
});
TrackJS.onTelemetry((type, telemetry) => {
  if (type === "con") {
    telemetry.message = telemetry.message.replace(/thing-that-looks-secret/, "SECRET");
  }
  return true;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants