Capture analytics

Track product events and customer traits with the Voidhash SDK.

The SDK attributes events to the current person and sends them in background batches. No separate analytics package is required.

Capture an event

voidhash.client.capture("upgrade_button_clicked", {
  source: "settings",
  plan: "monthly",
});

capture() is synchronous. It queues the event and returns immediately, including when the provider is still initializing.

Use clear, stable event names. Names beginning with $ are reserved for Voidhash events.

Automatic events

The SDK records common lifecycle events for you:

  • $app_installed
  • $app_updated
  • $app_opened
  • $app_backgrounded
  • $app_became_active
  • $sign_out

Flush before a boundary

Events flush automatically in batches (20 per request or every 5 seconds, retried with exponential backoff). Force delivery when the app is about to cross an important boundary:

await voidhash.client.flush();

Identity methods flush at the correct time automatically, so events captured before identify() or signOut() stay attached to the previous identity.

Update customer traits

See Set customer attributes — trait updates ride the same pipeline as analytics events.

Event capture API

Backend and non-mobile clients can send individual events or batches through the Event Capture API. Use the project's publishable token in the request body; do not send a secret key to the ingestion endpoint.

Next steps