Autocapture

Sessions, screens, and errors captured with no wiring, and how to configure or disable it.

The SDKs capture a baseline story on their own, so a project has data even before you add a single track() call. On by default in @vortexauth/core, @vortexauth/web, and @vortexauth/native.

What gets captured

EventWhen
app.openedClient construction (cold_start: true), and again when the app returns to the foreground after 30+ minutes away (cold_start: false).
screen.viewedWeb: the initial page and every client-side route change, deduplicated by path. Native: via the navigation hook below. Property: screen_name.
session.endedWhen a session closes, with duration_ms. Stamped with the time the session really ended, even when that is only detected later.
error.caughtWeb: window.onerror and unhandled promise rejections. Native: the global error handler (the previous handler still runs; fatal errors flush the queue immediately). Properties: error_name, error_message, error_stack (truncated), fatal, source.

Every event also carries $session_id. A session ends after 30 minutes in the background — the same convention other analytics tools use, so numbers stay comparable.

React Native screens

React Native has no browser history, so screen tracking needs one line:

<NavigationContainer onStateChange={analytics.navigationTracker()}>

Anywhere else, call analytics.screen('Paywall') yourself.

Reporting errors from your own code

analytics.captureError(err, { source: 'checkout' });

It never throws, and it is a no-op when error capture is disabled.

Configuration

new VortexAnalyticsClient({
  dsn,
  autocapture: false,                    // everything off
  // or per capability:
  autocapture: { errors: false },        // lifecycle + screens stay on
});

Capabilities: lifecycle (app.opened, sessions), screens, errors.