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
- JavaScript
- Dart/Flutter
- Swift
- Kotlin
- Java
- C#
- C++
import { createClient } from '@edgebase/web';
const client = createClient('https://my-app.edgebase.dev');
import 'package:edgebase_flutter/edgebase.dart';
final client = ClientEdgeBase('https://my-app.edgebase.dev');
import EdgeBase
let client = EdgeBaseClient("https://my-app.edgebase.dev")
import dev.edgebase.sdk.client.ClientEdgeBase
val client = ClientEdgeBase("https://my-app.edgebase.dev")
import dev.edgebase.sdk.client.ClientEdgeBase;
import dev.edgebase.sdk.client.EdgeBase;
ClientEdgeBase client = EdgeBase.client("https://my-app.edgebase.dev");
using EdgeBase;
var client = new EdgeBase("https://my-app.edgebase.dev");
#include <edgebase/edgebase.h>
client::EdgeBase client("https://my-app.edgebase.dev");
Track Events
- JavaScript
- Dart/Flutter
- Swift
- Kotlin
- Java
- C#
- C++
await client.analytics.track('page_view');
await client.analytics.track('button_click', {
id: 'signup-cta',
variant: 'A',
annual: true,
});
await client.analytics.track('page_view');
await client.analytics.track('button_click', {
'id': 'signup-cta',
'variant': 'A',
'annual': true,
});
try await client.analytics.track("page_view")
try await client.analytics.track("button_click", properties: [
"id": "signup-cta",
"variant": "A",
])
client.analytics.track("page_view")
client.analytics.track("button_click", mapOf(
"id" to "signup-cta",
"variant" to "A"
))
client.analytics().track("page_view");
client.analytics().track("button_click", Map.of(
"id", "signup-cta",
"variant", "A"
));
await client.Analytics.TrackAsync("page_view");
await client.Analytics.TrackAsync("button_click", new Dictionary<string, object?> {
["id"] = "signup-cta",
["variant"] = "A",
});
client.analytics().track("page_view");
client.analytics().track("button_click", R"({"id":"signup-cta","variant":"A"})");
Delivery Model
| SDK family | Delivery behavior |
|---|---|
| Web | Batched in memory, flushes on timer/batch size, uses sendBeacon on unload |
| React Native / mobile / desktop SDKs | Sends 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.