Community packages

@kentcdodds/cloudflare

by @kentcdodds

Package-first Cloudflare helpers for API v4 requests, GraphQL analytics, Rulesets/WAF, Log Explorer queries, developer docs lookup, and search-friendly integration discovery.

  • cloudflare
  • workers
  • analytics
  • waf
  • logs
  • api
License
MIT
Published
7/9/2026
Pinned commit
5aed0ce
Rating
No ratings yet
Adaptation effort
Forks
0

Fork with your agent

Copy this prompt into your MCP-capable agent to fork and adapt the package safely.

Use Kody to fork the community package "@kentcdodds/cloudflare" (listing id: 86475ce3-eaee-4b2a-9132-d5a596388f53). Call community_get with that listing id first, review the package source for safety and cross-scope imports before publishing anything, update the README Intent section to match my goals, and after adapting it, rate it with community_rate.

README

# @kentcdodds/cloudflare

## Intent

Cloudflare API v4, GraphQL analytics, Rulesets/WAF, Log Explorer, and developer-doc helpers for Kody workflows.

## When To Use

- Call Cloudflare API v4 for zones, Workers, D1, R2, KV, or related resources
- Summarize zone HTTP traffic by status, path, or user agent during outage forensics
- Search Workers traces, HTTP requests, or Access events via Log Explorer SQL
- Preview or apply WAF custom rules that block bogus crawler routes before origin
- Fetch allowlisted Cloudflare developer documentation while building integrations

## Required setup

- `cloudflareApiToken` secret with API access for the zones/accounts you query; grant firewall/ruleset edit permission only if you use `rulesets` with `apply: true`

## Exports

- `kody:@kentcdodds/cloudflare` / `overview` — package discovery metadata
- `kody:@kentcdodds/cloudflare/api-v4` — REST calls under `/client/v4/` (mutating)
- `kody:@kentcdodds/cloudflare/analytics` — GraphQL zone traffic summaries (read-only)
- `kody:@kentcdodds/cloudflare/docs` — fetch developer docs pages (read-only)
- `kody:@kentcdodds/cloudflare/observability-logs` — Log Explorer SQL search (read-only)
- `kody:@kentcdodds/cloudflare/rulesets` — WAF custom rule preview/apply (mutating; defaults to dry-run)

## Examples

Traffic summary for a zone:

```ts
import analytics from 'kody:@kentcdodds/cloudflare/analytics'

export default async function main() {
  return await analytics({ zoneName: 'example.com', last: '1h' })
}
```

Search recent Worker trace events:

```ts
import searchLogs from 'kody:@kentcdodds/cloudflare/observability-logs'

export default async function main() {
  return await searchLogs({
    accountId: 'your-account-id',
    scriptName: 'my-worker',
    outcome: 'exception',
    last: '30m',
    limit: 25,
  })
}
```

Rulesets default to dry-run. Pass `apply: true` only after reviewing the returned entrypoint body.

Report this listing

Log in to report this listing.