Capturing Logs

Capture React Native app events, live-session log lines, SDK bridge logs, and grouped session properties.

Use app events for timeline entries. Use sendClientLog(...) for ad hoc live-session log lines.

App Events

await Ansight.event({
  label: "Checkout loaded",
  type: "Info",
  details: "route=/checkout",
});

await Ansight.event({
  label: "Payment failed",
  type: "Error",
  details: "httpStatus=500",
});

Live Client Logs

await Ansight.sendClientLog("Checkout loaded cartId=debug-42");

sendClientLog(...) sends the line over the active live session. It does not automatically mirror console.log.

SDK Bridge Logs

const subscription = Ansight.addLogListener((entry) => {
  console.debug(`[Ansight:${entry.level}] ${entry.message}`);
});

subscription.remove();

Session Properties

await Ansight.registerCustomProperty("app", "region", "au");
await Ansight.removeCustomProperty("app", "region");
await Ansight.clearCustomProperties();

Grouped properties are sent with session.open and updated during an active live session.