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.
Files changed (2) hide show
  1. package/README.md +16 -10
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,16 +1,22 @@
1
1
  # Bezzie
2
2
 
3
- [![npm downloads](https://img.shields.io/npm/dw/bezzie)](https://www.npmjs.com/package/bezzie)
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
- **Bezzie** — your BFF's BFF. Handles the Backend for Frontend OAuth pattern so you don't have to.
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
- The BFF owns the OAuth flow and issues a session cookie to the frontend instead of handing tokens to the browser.
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
- npm install bezzie
13
- ```
13
+
14
+ [![npm version](https://img.shields.io/npm/v/bezzie)](https://www.npmjs.com/package/bezzie)
15
+ [![npm downloads](https://img.shields.io/npm/dw/bezzie)](https://www.npmjs.com/package/bezzie)
16
+ [![license](https://img.shields.io/npm/l/bezzie)](https://github.com/neilpmas/bezzie/blob/main/LICENSE)
17
+ [![GitHub](https://img.shields.io/badge/github-neilpmas%2Fbezzie-blue)](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
- Most OAuth libraries hand tokens directly to the browser. BCP212 says you shouldn't it's a significant attack surface. Bezzie keeps tokens server-side in Cloudflare KV and gives the browser a session cookie instead.
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
- 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.
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
- v0.1.0pre-release
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.1",
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.14.1",
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",