From altertable
Tracks events, identifies users, manages traits, aliases identities, and queries analytics data via SQL with Altertable SDKs and API. Use for product analytics, funnels, cohorts, retention.
npx claudepluginhub altertable-ai/skills --plugin altertableThis skill uses the workspace's default tool permissions.
1. **Track an event**: Call the track API or SDK method with event name and properties
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Builds production-ready Apache Airflow DAGs with patterns for operators, sensors, testing, and deployment. For data pipelines, workflow orchestration, and batch jobs.
Share bugs, ideas, or general feedback.
All SDKs and the API share the same payload shape:
| Field | Required | Description |
|---|---|---|
event | Yes | Event name, e.g. Checkout Completed |
properties | No | Event attributes for filtering and analysis |
distinct_id | No | User or device identifier (client SDKs set automatically) |
timestamp | No | Server uses current time when omitted |
curl -X POST https://api.altertable.ai/track \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event":"Purchase Completed",
"environment":"production",
"distinct_id":"u_01jza857w4f23s1hf2s61befmw",
"properties":{"amount":99.99,"currency":"USD"}
}'
altertable.track('Purchase Completed', {
amount: 99.99,
currency: 'USD'
});
Client-side SDKs automatically capture page/screen views. Disable with:
altertable.init('YOUR_API_KEY', { autoCapture: false });
altertable.page('https://example.com/products');
Server-side SDKs (Python, Ruby) do not auto-capture pages.
Call identify() after authentication to link anonymous activity to a known user.
curl -X POST https://api.altertable.ai/identify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"environment":"production",
"distinct_id":"u_01jza857w4f23s1hf2s61befmw",
"traits":{"plan":"premium","email":"user@example.com"}
}'
altertable.identify('u_01jza857w4f23s1hf2s61befmw', {
plan: 'premium',
email: 'user@example.com'
});
After identification, update traits as account state changes:
altertable.updateTraits({ plan: 'enterprise', onboarding_completed: true });
Server-side SDKs update traits by calling identify() again with new trait values.
Call reset() on logout to clear identity context:
altertable.reset();
altertable.reset({ resetDeviceId: true }); // also clears device ID
Use alias() to link multiple identifiers to the same user profile. This is for ID migrations and external system IDs, not for login flows (use identify() for those).
| Scenario | Method |
|---|---|
| Login or signup | identify() |
| Known user on another device | identify() |
| Migrate from old ID format | alias() |
| Attach CRM or billing ID | alias() |
| Merge profiles across platforms | alias() |
curl -X POST https://api.altertable.ai/alias \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"environment":"production",
"distinct_id":"user_123",
"new_user_id":"stripe:cus_abc123"
}'
altertable.alias(`stripe:${stripeCustomerId}`);
altertable.alias(`hubspot:${hubspotContactId}`);
SELECT
event,
properties->>'currency' AS currency,
COUNT(*) AS total
FROM altertable.analytics.events
GROUP BY ALL
ORDER BY total DESC;
SELECT
e.event,
e.properties,
e.timestamp,
e.identity_traits->>'email' AS email,
e.identity_traits->>'plan' AS plan
FROM altertable.analytics.events e
WHERE e.distinct_id = 'u_01jza857w4f23s1hf2s61befmw'
ORDER BY e.timestamp DESC;
SELECT
distinct_id,
traits->>'email' AS email,
traits->>'plan' AS plan,
updated_at
FROM altertable.analytics.identities
ORDER BY updated_at DESC;
| Language | Install |
|---|---|
| TypeScript/JS | npm install @altertable/altertable-js |
| React | npm install @altertable/altertable-js @altertable/altertable-react |
| Python | pip install altertable |
| Ruby | gem install altertable |
| Swift | Swift Package Manager |
| Kotlin | implementation("ai.altertable.sdk:altertable-kotlin:0.1.0") |
identify() after authentication, including after full page loads when user is already authenticatedidentify() for login/signup, alias() for ID migrations and external system linksdistinct_id explicitly