Skip to main content

Client SDK — Event Tracking

Track custom events from client SDKs with client.analytics.track(...).

The common cross-SDK contract is intentionally small:

  • track(name, properties?)
  • flush()

Platform-specific delivery behavior differs by SDK.

Supported Client SDKs​

  • JavaScript (@edgebase/web)
  • React Native (@edgebase/react-native)
  • Dart / Flutter
  • Swift
  • Kotlin
  • Java
  • C#
  • C++

Setup​

import { createClient } from '@edgebase/web';

const client = createClient('https://my-app.edgebase.dev');

Track Events​

await client.analytics.track('page_view');

await client.analytics.track('button_click', {
id: 'signup-cta',
variant: 'A',
annual: true,
});

Delivery Model​

SDK familyDelivery behavior
WebBatched in memory, flushes on timer/batch size, uses sendBeacon on unload
React Native / mobile / desktop SDKsSends immediately, flush() is a compatibility no-op

So analytics.flush() is meaningful on the web SDK, but safe to call everywhere.

Authentication​

If the client is signed in, analytics requests include the current auth token automatically. Anonymous tracking is also allowed.

Cleanup​

  • client.destroy() remains the main SDK cleanup entrypoint.
  • analytics.destroy() exists for compatibility, but outside the web SDK it is currently a no-op.