
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@project-sunbird/telemetry-sdk
Advanced tools
Telemetry Service javascript library helps to generate the telemetry events.
A robust, isomorphic JavaScript/TypeScript library for generating and syncing Sunbird telemetry events. This version is a complete rewrite using modern TypeScript, replacing legacy dependencies with standard NPM packages.
jquery, fingerprintjs2, md5 with:
fetch API (no jQuery dependency).@fingerprintjs/fingerprintjs for browser fingerprinting.crypto-js for hashing.ajv for schema validation.ua-parser-js for user agent parsing.localStorage caching to ensure consistent device IDs across browser sessions.npm install @project-sunbird/telemetry-sdk
import { $t } from '@project-sunbird/telemetry-sdk';
$t.initialize({
pdata: { id: 'my-app', ver: '1.0', pid: 'sunbird-portal' },
env: 'home',
channel: 'in.ekstep',
did: 'device-id', // Optional: Library will auto-generate if missing
authtoken: 'your-auth-token',
host: 'https://api.sunbird.org',
endpoint: '/v1/telemetry'
});
$t.start(
{}, // Config overrides
'content-id',
'1.0',
{ type: 'app', mode: 'play', pageid: 'home' }
);
$t.interact({
type: 'CLICK',
id: 'play-button',
pageid: 'home'
});
The library exposes a global Telemetry object. It also aliases window.$t and window.EkTelemetry for backward compatibility.
<script src="path/to/dist/index.global.js"></script>
<script>
$t.initialize({ ... });
$t.start(...);
</script>
const { $t } = require('@project-sunbird/telemetry-sdk');
// Note: In Node.js, you should ideally provide a 'did' (Device ID)
// or 'uid' (User ID) as fingerprinting relies on browser features.
$t.initialize({
pdata: { id: 'my-service', ver: '1.0' },
env: 'backend',
channel: 'in.ekstep',
host: 'https://api.sunbird.org',
batchsize: 10
});
$t.log({
type: 'api_access',
level: 'INFO',
message: 'API Request Received',
params: [{ url: '/api/v1/user' }]
});
| Property | Description | Default |
|---|---|---|
pdata | Producer Data (Required) | { id: "in.ekstep", ver: "1.0" } |
env | Environment (Required) | "contentplayer" |
channel | Channel ID (Required) | "in.ekstep" |
did | Device ID | Browser fingerprint or UUID (Node) |
uid | User ID | "anonymous" |
sid | Session ID | "" |
batchsize | Number of events to batch before syncing | 20 (Max 1000) |
host | API Host URL | https://api.ekstep.in |
endpoint | API Endpoint | /data/v3/telemetry |
authtoken | Authorization Token | "" |
enableValidation | Validate events against schema | false |
dispatcher | Custom dispatcher object { dispatch: (event) => {} } | undefined |
Note on Validation:
If enableValidation is set to true, the library validates events against the built-in Telemetry V3 schema. Events with missing or invalid schemas will be dropped.
npm run build: Build the library using tsup (generates dist/).npm run lint: Lint source code using eslint.npm test: Run unit tests using vitest.src/core: Core telemetry logic (Telemetry, TelemetrySyncManager).src/services: Services like DeviceService (fingerprinting) and Validator (schema).src/utils: Utilities (Dispatcher, Utils, DeviceInfo).src/schema: Telemetry JSON schemas.fetch.@fingerprintjs/fingerprintjs. This might generate different device IDs than the old library. However, localStorage caching is implemented to maintain the ID once generated.{ $t } or { Telemetry } instead of relying on globals.FAQs
Telemetry Service javascript library helps to generate the telemetry events.
We found that @project-sunbird/telemetry-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.