Documentation

SDKs

Altertable Product Analytics SDKs follow the same mental model across languages:

  1. Initialize a client with your API key.
  2. Track events with event properties.
  3. Identify users and attach traits.
  4. (Optional) Alias anonymous and known identities.

Quick Start by Language

Language
Install
Repository
TypeScript / JavaScript
npm install @altertable/altertable-js
React
npm install @altertable/altertable-js @altertable/altertable-react
Python
pip install altertable or poetry add altertable
Ruby
gem install altertable
Swift
Swift Package Manager
Kotlin / Android
JVM: implementation("ai.altertable.sdk:altertable-kotlin:0.1.0"); Android apps also add implementation("ai.altertable.sdk:altertable-android:0.1.0")

Client-Side vs Server-Side SDKs

SDKs fall into two categories with different capabilities:

Capability
Client-side
Server-side
Event tracking
Yes
Yes
User identification
Yes
Yes
Aliasing
Yes
Yes
Automatic page/screen tracking
Yes
No
Session & device ID management
Automatic
You pass distinct_id on each call
Tracking consent
Built-in
Manage externally
Event queuing & offline support
Yes
No

Page and Screen Tracking

Client-side SDKs auto-capture navigation events by default. The mechanism varies by platform:

  • JavaScript / React: Listens for popstate and hashchange browser events. Disable with autoCapture: false during init, then call altertable.page(url) manually.
  • Kotlin / Android: Auto-tracks Activity screen views when captureScreenViews is enabled (default). In Compose, use the .screenView(name:) modifier or TrackScreenView composable.
  • Swift / iOS: Auto-tracks UIKit view controller appearances when captureScreenViews is enabled (default). In SwiftUI, use the .screenView(name:) view modifier.

Server-side SDKs don't track pages or screens—include page context in event properties when needed.

Client-side SDKs include built-in consent management for privacy compliance. Events are queued while consent is pending and flushed automatically when consent is granted. If consent is denied, queued events are dropped.

State
Behavior
granted
Events are sent immediately.
denied
Events are dropped. Queue is cleared.
pending
Events are queued until consent changes.
dismissed
Events are queued (same as pending).

Set consent during initialization or update it at runtime:

// JavaScript — initialize with consent pending
altertable.init('YOUR_API_KEY', { trackingConsent: 'pending' });
// Later, when the user grants consent
altertable.configure({ trackingConsent: 'granted' });

Server-side SDKs don't manage consent—handle it in your application before sending events.

Cross-Language API Concepts

  • Initialization: Each SDK initializes with a project API key plus optional runtime configuration.
  • Tracking: Track an event name with structured properties.
  • Identity: Associate traits with a known user identifier (identify).
  • Alias: Link an anonymous/pre-login identity to a known user identity.
  • Consent and privacy: Consent controls are available in client-side SDKs—exact config names differ by language.

Next Steps

Crafted with <3 by former Algolia × Front × Sorare builders© 2026 AltertableTermsPrivacySecurityCookies