Skip to main content

Overview

The Timeback SDK provides an Express middleware adapter.

Installation

Server Setup

Create a Timeback instance:
lib/timeback.ts

Middleware

Add the Timeback middleware to your Express app:
server.ts

Alternative: Mount on Router

For more control, you can mount routes on an Express Router:
server.ts

Routes

The middleware handles these routes under /api/timeback:

Usage

Beyond the HTTP routes, you can use the Timeback instance directly for server-side operations like verifying users, fetching profiles, or recording activity completions:
server.ts
See user profile for full documentation on verify() and getProfile().

With Frontend Framework

When using Express with a frontend framework like React:
server.ts

Next Steps

React Client

Client-side React integration

Identity

Authentication options

Custom Activities

Track learning sessions