dbsc-toolkit 2.9.10 → 2.9.11

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.
Files changed (2) hide show
  1. package/README.md +22 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -56,6 +56,12 @@ The cookie copies fine. The key doesn't — it never left the user's device. So
56
56
 
57
57
  Chromium 145+ lands on `tier: "dbsc"` (TPM-backed); Firefox/Safari land on `tier: "bound"` (Web Crypto polyfill). Same guard either way.
58
58
 
59
+ ## Why DBSC Toolkit exists
60
+
61
+ Native DBSC currently ships only on Chromium-based browsers. That leaves Firefox, Safari, mobile, and older Chromium users on plain cookies — defeating the point if you're trying to stop cookie theft across your whole user base.
62
+
63
+ DBSC Toolkit extends device-bound sessions to those browsers through a Web Crypto polyfill, so every user gets the same per-request guard. Today it's one of the few open-source implementations providing cross-browser DBSC-style protection for Node.js.
64
+
59
65
  ## Install
60
66
 
61
67
  ```sh
@@ -69,6 +75,18 @@ npm install express ioredis # Express + Redis
69
75
  npm install fastify @fastify/cookie pg # Fastify + Postgres
70
76
  ```
71
77
 
78
+ ## Integration in 3 lines
79
+
80
+ Drop into an existing Express app — no rewrite of your login or session store:
81
+
82
+ ```ts
83
+ const dbsc = createDbsc({ storage }); // 1. configure once
84
+ dbsc.install(app); // 2. mount protocol routes + SDK
85
+ await dbsc.bind(res, sessionId, { userId }); // 3. bind, in your login route
86
+ ```
87
+
88
+ Then guard sensitive routes with `requireProof()`. The full picture:
89
+
72
90
  ## Quick start
73
91
 
74
92
  ```ts
@@ -120,7 +138,7 @@ Complete raw-`http` example: [docs/adapters.md](./docs/adapters.md#writing-your-
120
138
 
121
139
  ## How it compares
122
140
 
123
- | | Plain cookies | JWT (bearer) | Native DBSC (Chrome 146+) | **dbsc-toolkit** |
141
+ | | Plain cookies | JWT (bearer) | Native DBSC (Chrome 145+) | **dbsc-toolkit** |
124
142
  |---|:---:|:---:|:---:|:---:|
125
143
  | Replay-resistant (stolen cookie from another device) | ❌ | ❌ | ✅ | ✅ |
126
144
  | Works on Chrome / Edge / Brave | ✅ | ✅ | ✅ (TPM) | ✅ |
@@ -169,9 +187,8 @@ Every session carries a `tier`. You don't gate on it directly — `requireProof(
169
187
  | [`@dbsc-toolkit/better-auth`](./packages/better-auth/) | First-class [Better Auth](https://better-auth.com) plugin — binds every sign-in method automatically |
170
188
 
171
189
  ```ts
172
- // Better Auth, two lines:
173
- import { dbsc } from "@dbsc-toolkit/better-auth" // auth.ts → plugins: [dbsc()]
174
- import { dbscExpress } from "@dbsc-toolkit/better-auth/express" // server.ts → dbscExpress(auth).install(app)
190
+ // Better Auth — one plugin line, works on every framework:
191
+ import { dbsc } from "@dbsc-toolkit/better-auth" // auth.ts → plugins: [dbsc()]
175
192
  ```
176
193
 
177
194
  ## Roadmap
@@ -187,10 +204,6 @@ import { dbscExpress } from "@dbsc-toolkit/better-auth/express" // server.ts
187
204
  - [ ] Third-party security audit
188
205
  - [ ] WebAuthn step-up integration
189
206
 
190
- ## Used by
191
-
192
- Using DBSC Toolkit in production? Open a PR and add your project here.
193
-
194
207
  ## Subpath imports
195
208
 
196
209
  | Import | What it is |
@@ -215,7 +228,7 @@ Using DBSC Toolkit in production? Open a PR and add your project here.
215
228
 
216
229
  ## Status
217
230
 
218
- Verified end-to-end on Chrome 147 / Windows / TPM 2.0. Native DBSC requires Chromium 146+ on Windows or Apple Silicon macOS; the polyfill covers every browser with Web Crypto + IndexedDB. No third-party security audit yet — see [HOW-IT-WORKS.md#production-readiness](./HOW-IT-WORKS.md#production-readiness).
231
+ Verified end-to-end on Chrome 147 / Windows / TPM 2.0. Native DBSC requires Chromium 145+ on Windows or Apple Silicon macOS; the polyfill covers every browser with Web Crypto + IndexedDB. No third-party security audit yet — see [HOW-IT-WORKS.md#production-readiness](./HOW-IT-WORKS.md#production-readiness).
219
232
 
220
233
  ## License
221
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbsc-toolkit",
3
- "version": "2.9.10",
3
+ "version": "2.9.11",
4
4
  "description": "Server-side Device Bound Session Credentials (DBSC) for Node.js plus a Web Crypto polyfill for Firefox, Safari, and older Chromium. Cookie-theft protection on every modern browser.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",