bezzie 1.0.1 → 1.0.2
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 +16 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
# Bezzie
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> Bezzie is a BFF (Backend for Frontend) OAuth 2.0 library for Cloudflare Workers. It implements [BCP212](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps) — your frontend never sees a JWT.
|
|
3
|
+
**Your BFF's BFF.** OAuth for Cloudflare Workers + Hono, done the safe way.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
If you followed Auth0's SPA guide, your access token lives in the browser — in memory, in a Web Worker, or in localStorage. Any script that runs on your page can reach it. That's not a criticism of Auth0; it's just the default SPA pattern, and it's the one [BCP 212](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps) now recommends against.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Bezzie moves the OAuth flow into your Cloudflare Worker. Tokens stay server-side in KV. The browser gets an `HttpOnly; Secure; SameSite` session cookie — unreadable by JavaScript, unavailable to XSS. Your frontend code gets simpler, not more complicated.
|
|
10
8
|
|
|
9
|
+
```typescript
|
|
10
|
+
app.route('/auth', auth.routes()) // login, callback, logout
|
|
11
|
+
app.use('/api/*', auth.middleware()) // protect routes — user available as c.var.user
|
|
11
12
|
```
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
[](https://www.npmjs.com/package/bezzie)
|
|
15
|
+
[](https://www.npmjs.com/package/bezzie)
|
|
16
|
+
[](https://github.com/neilpmas/bezzie/blob/main/LICENSE)
|
|
17
|
+
[](https://github.com/neilpmas/bezzie)
|
|
18
|
+
|
|
19
|
+
---
|
|
14
20
|
|
|
15
21
|
## Get started in 5 minutes
|
|
16
22
|
|
|
@@ -66,9 +72,9 @@ Source: [github.com/neilpmas/bezzie-demo](https://github.com/neilpmas/bezzie-dem
|
|
|
66
72
|
|
|
67
73
|
## Why
|
|
68
74
|
|
|
69
|
-
|
|
75
|
+
There's no open source library for this specific combination (BFF OAuth on Cloudflare Workers). The closest alternatives are Duende BFF (.NET) and `@auth0/nextjs-auth0` — both tied to specific frameworks and neither running at the edge.
|
|
70
76
|
|
|
71
|
-
|
|
77
|
+
Bezzie is framework-agnostic, Workers-native, and ships with adapters for Cloudflare KV, Redis (including Upstash), and in-memory storage.
|
|
72
78
|
|
|
73
79
|
---
|
|
74
80
|
|
|
@@ -280,7 +286,7 @@ wrangler secret put AUTH0_CLIENT_SECRET
|
|
|
280
286
|
|
|
281
287
|
## Status
|
|
282
288
|
|
|
283
|
-
|
|
289
|
+
v1.0.1 — stable
|
|
284
290
|
|
|
285
291
|
---
|
|
286
292
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bezzie",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"engines": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"hono": "^4.0.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@cloudflare/vitest-pool-workers": "^0.
|
|
67
|
+
"@cloudflare/vitest-pool-workers": "^0.15.1",
|
|
68
68
|
"@cloudflare/workers-types": "^4.20260317.1",
|
|
69
69
|
"@eslint/js": "^10.0.1",
|
|
70
70
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|