You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- New CloudflareWorkersHandler in the request layer mirroring the
Lambda/Node/Browser pattern, with cookie/header/redirect helpers
aligned with crowdhandler-cloudflare-integration.
- RequestContext + init() accept cloudflareWorkersRequest, with a
matching function overload for type inference.
- BaseClient detects workerd via navigator.userAgent and routes HTTP
through native fetch + AbortController, preserving the axios error
shape so existing handlers keep working. Node/Lambda continue to use
axios unchanged.
- package.json gains an exports map with workerd/worker conditions
pointing Workers bundlers at the ESM build.
- README documents Workers usage end-to-end.
The SDK ships with native support for the Cloudflare Workers (workerd) runtime — no Node polyfills required. Pass the Workers `Request` object via `cloudflareWorkersRequest` and the SDK uses native `fetch` internally for all API calls.
// Performance recording continues after the response is returned
660
+
ctx.waitUntil(gatekeeper.recordPerformance());
661
+
return response;
662
+
}
663
+
};
664
+
```
665
+
666
+
**Workers vs. Express/Lambda — what's different:**
667
+
668
+
- Workers have no mutable response object. Build the outgoing `Response` yourself using values from `result` (`cookieValue`, `targetURL`, `setCookie`) rather than relying on helper methods that mutate a response in place.
669
+
- Use `ctx.waitUntil()` for `recordPerformance()` so the metric call doesn't delay the user's response.
670
+
- Default `mode:'full'` (used above) only needs the public key. Hybrid mode is supported but requires shipping your private key as a Worker secret — only do this if you've assessed the trade-off.
0 commit comments