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

await voidhash.capture("upgrade_button_clicked", properties: [
    "source": .string("settings"),
    "plan": .string("monthly"),
])

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.flush()

Sends everything queued right now.

Update customer traits

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

Next steps