@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 +21 -22
- package/dist/edge.d.ts +1 -1
- package/dist/index.js +516 -347
- package/dist/server/adapters/express.js +320 -195
- package/dist/server/adapters/nuxt.js +320 -195
- package/dist/server/adapters/solid-start.js +320 -195
- package/dist/server/adapters/tanstack-start.js +320 -195
- package/dist/server/lib/resolve.d.ts +2 -2
- package/dist/server/timeback-identity.d.ts +2 -2
- package/dist/server/types.d.ts +3 -3
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/types.d.ts +3 -3
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +2 -6
- package/dist/config.d.ts +0 -20
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -0
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.
|
|
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 `
|
|
433
|
-
(Cloudflare Workers / workerd) do not support the Node modules that `
|
|
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.
|
|
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
|
-
```
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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:
|
|
560
|
-
grade: 3,
|
|
561
|
-
courseCode:
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
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 `
|
|
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
|
*/
|