@cloudflare/workers-auth
0.18.6 · 20 Nov 2026MIT OR Apache-2.0565.1k / weekRepositoryHomepagenpmAtom feed
0.18.6 is the newest release of 0.10.x.
In short
3 new1 internal
Release note
Minor Changes
Allow cf to request the account token creation scope
New cf OAuth logins can request
account_api_tokens:create. Existing sessions must authenticate again to receive the scope.Add beta K2 producer bindings for existing streams
Configure a stream created through Wrangler, the Dashboard, or the API in
wrangler.json:{ "k2": [ { "binding": "ORDERS", "stream": "0123456789abcdef0123456789abcdef" } ] }The binding supports
env.ORDERS.send([{ content: new TextEncoder().encode("order"), headers: { event: "order.created" } }]). Batches use either allArrayBufferor allUint8Arraycontent. Check the returnedsuccessvalue, handle rejected RPC promises, and retry only when the returned error explicitly allows it. Generated environment types describe this producer contract without requiring a separate application dependency.K2 requires an enabled account. Deployment credentials need Worker deployment and K2 configuration-read access. Default Wrangler logins now request the K2 OAuth scopes; existing OAuth users should run
wrangler loginagain to grant the new permissions. Development always uses a real K2 stream and may incur usage charges; no local simulator is provided. Theremotesetting can be omitted,remote: truesuppresses the usage warning, andremote: falseis rejected. Consumption is not part of this Worker binding.Add beta K2 stream management commands
Use
wrangler k2 streams create order_events,wrangler k2 streams list,wrangler k2 streams get <stream-id>, andwrangler k2 streams delete <stream-id>to manage K2 streams. Creation enables Worker bindings but not HTTP ingestion by default, matching the dashboard. Pass--http-enabledto enable authenticated HTTP ingestion and print its endpoint. Creation prints the stream ID and a binding configuration with aYOUR_BINDING_NAMEplaceholder for the Worker's variable name, but does not edit the configuration file automatically.All four commands support
--json. Deletion requires confirmation, or--force/-yto skip it; use--force --jsonfor JSON deletion output. Creation also accepts retention, HTTP authentication, Worker-input, and CORS options; listing supports pagination and a name filter. Default Wrangler logins now requestk2.readandk2.write; existing OAuth users should runwrangler loginagain, or use a custom API token granting K2 Config Write. The account must be enabled for K2.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.