Skip to main content
Timeback provides TypeScript clients for direct API access to all services. Use these when you need fine-grained control over API interactions or want to build custom integrations.

Available Clients

PackageDescription
@timeback/onerosterOneRoster 1.2 API for rostering, enrollments, and gradebook
@timeback/edubridgeEduBridge API for analytics and simplified resource management
@timeback/caliperCaliper Analytics API for learning events
@timeback/qtiQTI API for assessments and question items
@timeback/powerpathPowerPath API for adaptive learning

Installation

Install individual clients as needed:
npm install @timeback/oneroster
npm install @timeback/edubridge
npm install @timeback/caliper
npm install @timeback/qti
npm install @timeback/powerpath
Or install all via the SDK:
npm install @timeback/sdk

Authentication

All clients use OAuth 2.0 client credentials flow. There are two configuration modes: Connect to Timeback platforms with automatic URL resolution:
import { OneRosterClient } from '@timeback/oneroster'

const client = new OneRosterClient({
	env: 'staging', // or 'production'
	auth: {
		clientId: process.env.ONEROSTER_CLIENT_ID!,
		clientSecret: process.env.ONEROSTER_CLIENT_SECRET!,
	},
})

Explicit Mode

Connect to custom OneRoster APIs:
const client = new OneRosterClient({
	baseUrl: 'https://api.example.com',
	auth: {
		clientId: process.env.ONEROSTER_CLIENT_ID!,
		clientSecret: process.env.ONEROSTER_CLIENT_SECRET!,
		authUrl: 'https://auth.example.com/oauth2/token',
	},
})
Tokens are automatically managed:
  • Fetched on first request
  • Cached for subsequent requests
  • Refreshed when expired

SDK Integration

When using the full SDK, clients are available via timeback.api:
import { createTimeback } from '@timeback/sdk'

const timeback = await createTimeback({
	env: 'staging',
	api: {
		clientId: process.env.TIMEBACK_API_CLIENT_ID!,
		clientSecret: process.env.TIMEBACK_API_CLIENT_SECRET!,
	},
	identity: {
		/* ... */
	},
})

const { data: users } = await timeback.api.oneroster.users.list()
const { data: enrollments } = await timeback.api.edubridge.enrollments.list()
await timeback.api.caliper.events.sendActivity(sensorUrl, activityData)

Common Patterns

All clients follow consistent CRUD patterns:
client.users.list({ limit?, offset?, where? })
client.users.get(id)
client.users.create({ ...fields })
client.users.update(id, { ...fields })
client.users.delete(id)
client.users.stream()
MethodReturnsDescription
list()PageResultList with pagination/filters
get()ResourceGet by ID
create()CreateResponseCreate new resource
update()voidUpdate existing resource
delete()voidDelete resource
stream()AsyncIterableStream all results efficiently

Environment Configuration

Configure clients via environment variables (when using environment mode, URLs are auto-resolved):
.env
# OneRoster
ONEROSTER_CLIENT_ID=your-client-id
ONEROSTER_CLIENT_SECRET=your-client-secret

# EduBridge
EDUBRIDGE_CLIENT_ID=your-client-id
EDUBRIDGE_CLIENT_SECRET=your-client-secret

# Caliper
CALIPER_CLIENT_ID=your-client-id
CALIPER_CLIENT_SECRET=your-client-secret

# QTI
QTI_CLIENT_ID=your-client-id
QTI_CLIENT_SECRET=your-client-secret

Client Guides