SDK
TypeScript / Web
Browser SDK with auto-tracking. Drop in a script tag and start sending events.
01.Install the SDK
bash
npm install @apext/analytics-sdk-ts
02.Initialize the client
typescript
import { OrbitAnalytics } from "@apext/analytics-sdk-ts"
export const orbit = new OrbitAnalytics({
apiKey: process.env.NEXT_PUBLIC_ORBIT_API_KEY!,
baseUrl: "https://apext.dev/orbit",
serviceName: "my-web-app",
})03.Track an event
typescript
orbit.track({
event_name: "user_signed_up",
user_id: "user_123",
event_properties: { plan: "pro" },
})04.Identify the user (optional)
typescript
orbit.identify("user_123", {
email: "user@example.com",
display_name: "Jane Doe",
})05.Automatic error capture
typescript
// The SDK automatically catches:
// - window.onerror (JS runtime errors)
// - unhandledrejection (promise rejections)
//
// No setup required — AutoTracker handles it.
// You can also send errors manually:
// orbit.error({ error_type: e.name, error_message: e.message, stack_trace: e.stack })Need help? support@apext.dev