@timeback/sdk 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,7 +40,7 @@ bun add timeback
40
40
 
41
41
  ## Server Adapters
42
42
 
43
- All server adapters use the same core configuration:
43
+ All server adapters use the same core configuration and require a `timeback.config.json` file:
44
44
 
45
45
  ```typescript
46
46
  // lib/timeback.ts
@@ -420,7 +420,7 @@ The SDK resolves the Timeback user by email. You only need to provide the authen
420
420
  If you only need Timeback SSO authentication without activity tracking or Timeback API integration, use `createTimebackIdentity()`. This is a lightweight alternative that:
421
421
 
422
422
  - Does not require Timeback API credentials
423
- - Does not require `timeback.config.ts`
423
+ - Does not require `timeback.config.json`
424
424
  - Only exposes identity routes (sign-in, callback, sign-out)
425
425
  - Returns raw OIDC user info (no Timeback profile enrichment)
426
426
 
@@ -429,8 +429,8 @@ If you only need Timeback SSO authentication without activity tracking or Timeba
429
429
  ### Cloudflare Workers / workerd compatibility
430
430
 
431
431
  `createTimebackIdentity()` is runtime-agnostic, but the main `timeback` entrypoint also includes
432
- Node-oriented functionality (notably config loading via `jiti`). Some edge runtimes
433
- (Cloudflare Workers / workerd) do not support the Node modules that `jiti` depends on.
432
+ Node-oriented functionality (notably config loading via `c12`). Some edge runtimes
433
+ (Cloudflare Workers / workerd) do not support the Node modules that `c12` depends on.
434
434
 
435
435
  If you're deploying identity-only SSO on Workers/workerd, import from the worker-safe entrypoint:
436
436
 
@@ -542,7 +542,7 @@ await activity.end({
542
542
 
543
543
  The SDK automatically sends activity data to your server, which forwards it to the Timeback API.
544
544
 
545
- **Note:** Activity ingestion requires an **effective Caliper sensor URL per course** in `timeback.config.ts`.
545
+ **Note:** Activity ingestion requires an **effective Caliper sensor URL per course** in `timeback.config.json`.
546
546
 
547
547
  Sensor precedence (highest → lowest):
548
548
 
@@ -550,24 +550,23 @@ Sensor precedence (highest → lowest):
550
550
  - per-course base override: `course.sensor`
551
551
  - top-level default: `config.sensor`
552
552
 
553
- ```typescript
554
- export default {
555
- name: 'My App',
556
- sensor: 'https://my-app.example.com/sensors/default',
557
- courses: [
553
+ ```json
554
+ {
555
+ "$schema": "https://timeback.dev/schema.json",
556
+ "name": "My App",
557
+ "sensor": "https://my-app.example.com/sensors/default",
558
+ "courses": [
558
559
  {
559
- subject: 'Math',
560
- grade: 3,
561
- courseCode: 'MATH-3',
562
- // Base override (all envs)
563
- sensor: 'https://my-app.example.com/sensors/math',
564
- // Env-specific overrides (applied when syncing/editing in that env)
565
- overrides: {
566
- staging: { sensor: 'https://staging.my-app.example.com/sensors/math' },
567
- production: { sensor: 'https://my-app.example.com/sensors/math' },
568
- },
569
- },
570
- ],
560
+ "subject": "Math",
561
+ "grade": 3,
562
+ "courseCode": "MATH-3",
563
+ "sensor": "https://my-app.example.com/sensors/math",
564
+ "overrides": {
565
+ "staging": { "sensor": "https://staging.my-app.example.com/sensors/math" },
566
+ "production": { "sensor": "https://my-app.example.com/sensors/math" }
567
+ }
568
+ }
569
+ ]
571
570
  }
572
571
  ```
573
572
 
package/dist/edge.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Timeback (edge/worker friendly entrypoint)
3
3
  *
4
4
  * This entrypoint is intended for runtimes like Cloudflare Workers / workerd.
5
- * It avoids importing Node-only dependencies (notably config loading via `jiti`).
5
+ * It avoids importing Node-only dependencies (notably config loading via `c12`).
6
6
  *
7
7
  * It includes identity-only SSO plus a small set of edge-safe helpers.
8
8
  */