Overview
The Timeback SDK provides a Next.js adapter for the App Router with route handlers. If you are using coding agents, pair this page withtimeback-server from the AI Skills catalog.
Installation
Server Setup
Create a server-only Timeback instance. The session helpers below belong to your application: persist the callback user in your authenticated session, and return that session user (includingemail) or null from getUser. These helpers are not SDK exports. Keep API and SSO secrets on the server:
lib/timeback.ts
Route Handler
Create a catch-all route handler:app/api/timeback/[...timeback]/route.ts
Client Provider
Wrap your app with the TimebackProvider:app/providers.tsx
app/layout.tsx
Usage
Use hooks in client components:components/UserStatus.tsx
Next Steps
React Client
Client-side React integration
Identity
Authentication options
Custom Activities
Track learning sessions