arcjet / arcjet-js

Arcjet JS SDKs. Rate limiting, bot protection, email verification & attack defense for Node.js, Next.js, Bun & SvelteKit.
https://arcjet.com
Apache License 2.0
172 stars 3 forks source link

Support for Cloudflare Workers #759

Open davidmytton opened 1 month ago

davidmytton commented 1 month ago

Allow us to support applications built on Cloudflare workers. There's a lot of useful data in the request context cf property we could make use of.

blaine-arcjet commented 3 weeks ago

This is blocked by Connect RPC's requirement to construct a client with a baseUrl. We want to avoid reconstructing a client on each request to the worker.

blaine-arcjet commented 3 weeks ago

Related: Connect doesn't work well on Cloudflare, see https://github.com/connectrpc/connect-es/issues/577

blaine-arcjet commented 3 weeks ago

Someone suggested dynamic baseUrl in https://github.com/connectrpc/connect-es/issues/678 but it was closed as wontfix.