@timeback/sdk 0.2.1-beta.20260313210405 → 0.2.1-beta.20260314020510
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 +14 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @timeback/sdk
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for integrating Timeback into your application. Provides server-side route handlers and client-side components for activity tracking and SSO authentication.
|
|
4
4
|
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Quick Start](#quick-start)
|
|
9
|
-
- [Server Adapters](#server-adapters)
|
|
10
|
-
- [Next.js](#nextjs)
|
|
11
|
-
- [Nuxt](#nuxt)
|
|
12
|
-
- [SvelteKit](#sveltekit)
|
|
13
|
-
- [SolidStart](#solidstart)
|
|
14
|
-
- [TanStack Start](#tanstack-start)
|
|
15
|
-
- [Express](#express)
|
|
16
|
-
- [Client Adapters](#client-adapters)
|
|
17
|
-
- [React](#react)
|
|
18
|
-
- [Vue](#vue)
|
|
19
|
-
- [Svelte](#svelte)
|
|
20
|
-
- [Solid](#solid)
|
|
21
|
-
- [Identity Modes](#identity-modes)
|
|
22
|
-
- [Identity-Only Integration](#identity-only-integration)
|
|
23
|
-
- [Activity Tracking](#activity-tracking)
|
|
24
|
-
- [Advanced: Direct API Access](#advanced-direct-api-access)
|
|
25
|
-
|
|
26
5
|
## Installation
|
|
27
6
|
|
|
28
7
|
```bash
|
|
29
|
-
|
|
30
|
-
#
|
|
31
|
-
bun add timeback
|
|
8
|
+
bun add @timeback/sdk
|
|
9
|
+
# npm install @timeback/sdk
|
|
32
10
|
```
|
|
33
11
|
|
|
34
12
|
## Quick Start
|
|
35
13
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
```typescript
|
|
15
|
+
import { createTimeback } from '@timeback/sdk'
|
|
16
|
+
|
|
17
|
+
const timeback = await createTimeback({
|
|
18
|
+
env: 'staging',
|
|
19
|
+
api: { clientId: '...', clientSecret: '...' },
|
|
20
|
+
identity: { mode: 'custom', getEmail: async req => getSession(req)?.email },
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then: (1) create a server instance with your credentials, (2) mount the route handlers for your framework, (3) wrap your app with the client provider, (4) use hooks/composables to track activities.
|
|
40
25
|
|
|
41
26
|
## Server Adapters
|
|
42
27
|
|