Overview
The Caliper client provides access to the Caliper Analytics API, enabling:- Activity Events: Track learning activity completions with metrics
- Time Spent Events: Record time spent on activities
- Generic Events: Send any IMS Caliper v1.2 event
- Batching: Combine multiple events in a single API call
- Job Monitoring: Track asynchronous event processing
Installation
Quick Start
Client Structure
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 |
Query Events
Retrieve stored events:Batching Events
Use factory functions to combine multiple events in a single API call:Generic Events
For non-Timeback events, use the generic API:Error Handling
SDK Integration
When using the full SDK, activity tracking automatically emits Caliper events:Next Steps
Custom Activities
SDK-based activity tracking
EduBridge
Pre-aggregated analytics
Types
Caliper type definitions