Overview
The@timeback/caliper package provides a TypeScript client for the Caliper Analytics API, enabling:
- Activity Events: Track learning activity completions with metrics
- Time Spent Events: Record time spent on activities
- Batch Processing: Monitor event processing jobs
Installation
Quick Start
Activity Completed Events
Track when users complete learning activities:Metric Types
| Type | Description |
|---|---|
totalQuestions | Total number of questions attempted |
correctQuestions | Number of correct answers |
xpEarned | Experience points earned |
masteredUnits | Number of units mastered |
Time Spent Events
Track time spent on activities:Job Monitoring
Event processing is asynchronous. Monitor job status:| Method | Returns | Description |
|---|---|---|
sendActivity() | { jobId } | Send events, get job ID |
getStatus() | JobStatus | Check status: pending/processing/completed/failed |
waitForCompletion() | JobStatus | Poll until job completes |