Bezzie is a BFF (Backend for Frontend) OAuth 2.0 authentication library for Cloudflare Workers, currently at v1.0.1 (April 2026). It implements BCP212 (OAuth for Browser-Based Apps) by keeping tokens server-side in Cloudflare KV and issuing session cookies to the frontend, preventing JWTs from ever reaching the browser. It integrates seamlessly with Hono (v4) and supports providers like Auth0, Google, and generic OIDC. Compared to alternatives (Duende BFF, @auth0/nextjs-auth0), Bezzie is framework-agnostic, runs on Cloudflare Workers' edge, and is TypeScript-first with ESM-only distribution. Active development with recent breaking changes in v1.0.0.
npm install bezzieVerified import paths — ran on the pinned version, not inferred.
Sets up Bezzie with Auth0 provider and memory adapter, mounts auth routes, protects an API endpoint.
Replace `new MemoryAdapter()` with `memoryAdapter()`, `new RedisAdapter(client)` with `redisAdapter(client)`. `cloudflareKVAdapter(kv)` remains unchanged.
Migrate to the new adapter factory functions (e.g., cloudflareKVAdapter(env.SESSION_KV)).
Use `import` syntax or set `"type": "module"` in package.json.
Upgrade Hono to v4: `npm install hono@^4.0.0`.
In production, use `cloudflareKVAdapter(env.SESSION_KV)` or a persistent adapter.
Use `routes: { login: '/signin', callback: '/cb', logout: '/signout' }` to avoid conflicts.Update to bezzie@^1.0.0: `npm install bezzie@latest`
Change `import { cloudflareKVAdapter } from 'bezzie/adapters'` to `import { cloudflareKVAdapter } from 'bezzie'`Use factory functions: `cloudflareKVAdapter(env.SESSION_KV)` instead of `new CloudflareKVAdapter(env.SESSION_KV)`
Add `"type": "module"` to package.json or rename file to .mjs