> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timeback.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Versioned example projects and guidance for adapting them

The SDK repository contains example projects for the integrations below. These are demos, with their own setup scripts and shortcuts. Use the linked current API guides when adapting them, and check the SDK version in the example's package file.

## Before running an example

* Read its server configuration and environment template. Several SSO demos use a process-wide in-memory session and placeholder API credentials. Replace those with authenticated per-user sessions and real server credentials before connecting real users.
* In the reviewed Bun/React and framework SSO demos, `TIMEBACK_DEMO_SEND_ACTIVITY` defaults to off. Hooks return `null` and suppress completion and time events. Seeing a preview log is not evidence of ingestion.
* Browser client initialization is not authentication. Start an activity from a user action after authentication and await `end()` before starting another. Automatic mount/cleanup effects can race asynchronous completion, including during development remounts.
* Example setup scripts can create remote resources. Review their environment and operations before running them. A local route check does not validate downstream analytics or durable delivery.

## Choose a project

### bun-react

Bun and React SSO/activity demo. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/bun-react) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/client/react.md).

### bun-react-full

Bun/React demo with direct API access. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/bun-react-full) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/clients/core.md).

### bun-react-gradeless

Course-code selection without a grade. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/bun-react-gradeless) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/reference/configuration.md).

### bun-react-identity-only

Identity-only SSO without the activity API. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/bun-react-identity-only) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/identity.md).

### bun-react-resumable

Multi-session activity demo. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/bun-react-resumable) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/activity-tracking/stateful.md).

### express

Express server adapter demo. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/express) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/express.md).

### express-auth0

Custom identity using an Auth0-backed session. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/express-auth0) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/identity.md).

### express-auth0-launch-gate

Auth0 bearer-token and launch-entry demo. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/express-auth0-launch-gate) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/identity.md).

### express-supabase

Custom identity using a Supabase-backed session. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/express-supabase) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/identity.md).

### nextjs-app-router

Next.js App Router integration. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/nextjs-app-router) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/nextjs.md).

### nuxt

Nuxt server and Vue browser integration. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/nuxt) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/nuxt.md).

### qti-with-powerpath

PowerPath/QTI assessment demonstration. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/qti-with-powerpath) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/managed-lessons/intro.md).

### solid-start

SolidStart server and Solid browser integration. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/solid-start) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/solidstart.md).

### svelte-kit

SvelteKit hooks and browser stores. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/svelte-kit) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/sveltekit.md).

### tanstack-start

TanStack Start server and React browser integration. [Source at the reviewed revision](https://github.com/superbuilders/timeback-dev/tree/0936b08fba44ee1ba7967fd7e5161950d867eff8/examples/tanstack-start) · [Integration guide](https://docs.timeback.com/beta/build-on-timeback/sdk/server/tanstack-start.md).

## Adapt activity tracking

Use the [single-session guide](https://docs.timeback.com/beta/build-on-timeback/sdk/activity-tracking/single-session.md) for a start → complete flow. For resumable work, persist your own activity state and use [stateful activities](https://docs.timeback.com/beta/build-on-timeback/sdk/activity-tracking/stateful.md). The browser tracker owns timers; the server `activity.record()` method records supplied metrics and optional measured time.

App-supplied `xpEarned` is not automatically calculated from duration or gated at 80% accuracy by the custom activity SDK. Implement the agreed policy in your application and verify the emitted data. The [course progress guide](https://docs.timeback.com/beta/build-on-timeback/sdk/activity-tracking/course-progress.md) explains the separate analytics-based progress calculation and its limits.

## Adapt managed lessons

The `qti-with-powerpath` example has its own setup data, quiz routes, thresholds, and renderer. Its question counts and expected question totals are demonstration configuration, not universal PowerPath guarantees.

Use [Managed Lessons](https://docs.timeback.com/beta/build-on-timeback/sdk/managed-lessons/intro.md) for the current browser/server contract. Linear answer submission may return placeholder correctness until finalization. Completion responses must be inspected; an HTTP success or the `timeTrackingSent` flag alone does not prove mastery or downstream time-event persistence.

## Configure a gradeless course

A course without `grade` requires a unique `courseCode`, a supported subject, and a sensor or launch URL resolvable in the target environment:

```json timeback.config.json theme={null}
{
  "name": "CodeQuest",
  "launchUrl": "https://codequest.example.com/start",
  "courses": [
    {
      "subject": "Other",
      "courseCode": "INTRO-CS-101",
      "ids": null
    }
  ]
}
```

Run `timeback resources push --env staging` to provision IDs. In an SDK activity reference use `{ code: 'INTRO-CS-101' }`; the config field is named `courseCode`.

## Verify the integration

1. Verify a real authenticated test user resolves to the expected Timeback user.
2. Check the selected platform, environment, and course IDs.
3. Start and finish an activity; inspect the HTTP results and error callbacks.
4. Verify the raw event in the intended receiver and the resulting downstream analytics separately. Account for processing delay and failures.
5. For managed lessons, test question rendering, scoring, finalization, and attempt history for the lesson types your app uses.
