Skip to content

feat(cloudflare/ratelimit): add RateLimit binding#238

Open
agcty wants to merge 1 commit into
alchemy-run:mainfrom
agcty:codex/cloudflare-ratelimit-binding
Open

feat(cloudflare/ratelimit): add RateLimit binding#238
agcty wants to merge 1 commit into
alchemy-run:mainfrom
agcty:codex/cloudflare-ratelimit-binding

Conversation

@agcty
Copy link
Copy Markdown
Contributor

@agcty agcty commented May 5, 2026

Adds a Cloudflare RateLimit marker and binding policy so Workers can attach type: "ratelimit" metadata via direct bindings or init-phase RateLimit.bind.

const signupThrottle = yield* Cloudflare.RateLimit({
  namespaceId: 1001,
  simple: { limit: 10, period: 60 },
});

export const Worker = Cloudflare.Worker("Worker", {
  main: "./src/worker.ts",
  bindings: { SIGNUP_THROTTLE: signupThrottle },
});

Depends on alchemy-run/distilled#256 for generated Workers upload schema support.

@agcty agcty force-pushed the codex/cloudflare-ratelimit-binding branch from 04876c8 to 33b5b6c Compare May 5, 2026 11:09
@agcty
Copy link
Copy Markdown
Contributor Author

agcty commented May 5, 2026

Verification update:

@agcty agcty force-pushed the codex/cloudflare-ratelimit-binding branch from 33b5b6c to 1df55f3 Compare May 6, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant