Platform SDKs
Budget guardrails for Cloudflare Workers.
Two packages — a lightweight SDK for each Worker and a CLI scaffolder for the backend. Circuit breakers, budget enforcement, anomaly detection, and distributed tracing. Zero production dependencies.
What it stops
Catches runaway costs before they reach your invoice
Infinite loops
A D1 write loop ran for four days before I noticed. 4.8 billion rows. Circuit breakers would have stopped it in minutes.
Budget overruns
Daily and monthly spend limits with warnings at 70% and 90%. Hard stop at 100% — no more invoice surprises.
Anomaly spikes
Flags unusual resource spikes — sudden D1 write volume, unexpected AI call patterns — before they become invoices.
Silent failures
Standard tier auto-creates GitHub issues from Worker errors. Full tier adds AI-powered pattern discovery for transient vs real failures.
What Platform SDKs includes
Three-tier circuit breakers
Global kill switch, project-level breakers, and per-feature breakers. Any level can stop expensive operations instantly.
Budget enforcement
Daily and monthly limits with progressive warnings at 70%, 90%, and hard stop at 100%. Per-invocation request caps prevent runaway handlers.
Anomaly detection
Flags unusual resource spikes without blocking. Configurable thresholds per feature — catch problems before they become invoices.
W3C distributed tracing
Full traceparent/tracestate propagation across service bindings. Trace a request from entry to every downstream Worker.
Structured JSON logging
Log levels, correlation ID extraction, timed operations, and child loggers. Built for production debugging, not console.log.
AI Gateway tracking
Automatic provider and model detection for 10+ AI providers. Track cost per model, per feature, per day.
Automatic binding telemetry
Every D1, KV, R2, AI, Vectorize, Queue, Durable Object, and Workflow call tracked without code changes.
Multi-account support
Consumer SDKs across separate Cloudflare accounts send telemetry to one centralised admin backend. One dashboard for everything.
Health checks and heartbeats
Dual-plane validation: control plane (KV + circuit breaker) and data plane (queue delivery). Durable Object alarm-based heartbeats with Gatus integration.
Error collection
Standard tier tail worker auto-creates GitHub issues from production errors. Full tier adds AI pattern discovery for transient vs real failures.
How it works
Two packages — one per Worker, one per account. Your infrastructure, your data.
What exactly does it access?
What it accesses
- Cloudflare Workers binding usage (D1, KV, R2, AI, Vectorize, Queue, DO, Workflow)
- Invocation counts, error rates, and cost metrics per feature
Where it stores
- Usage data: D1 database on your Cloudflare account
- Circuit breaker state: KV namespace on your Cloudflare account
- Configuration: wrangler.toml and budgets.yaml in your project
Delete the admin Worker and D1 database from your Cloudflare dashboard to remove all data
Network calls
- Worker-to-Worker service bindings within your Cloudflare account
- No Little Bear Apps servers involved — everything runs on your infrastructure
Remove the withFeatureBudget() wrapper to disable tracking
Get notified when Platform SDKs is ready
Leave your details and I'll let you know when it's available.
No spam, ever. Privacy Policy
"An infinite D1 write loop ran for four days. 4.8 billion rows. $4,868 bill."
Questions about Platform SDKs
What is Platform SDKs?
Is this free?
What's the difference between Consumer SDK and Admin SDK?
What Cloudflare bindings does it track?
Does this send data to Little Bear Apps?
What happens when a circuit breaker trips?
Can I use this with multiple Cloudflare accounts?
What was the $4,868 billing incident?
Is there a Claude Code plugin for Platform SDKs?
What changes
- • Instead of discovering runaway costs on your monthly invoice, get warnings at 70% and hard stops at 100%.
- • Instead of hoping Cloudflare's billing alerts catch problems in time, circuit breakers trip per-request.
- • Instead of guessing which Worker is responsible for a cost spike, see per-feature breakdowns.
- • Instead of building your own usage tracking, scaffold the entire backend with one CLI command.
- • Instead of manually monitoring Worker health, get automatic heartbeats and dual-plane health checks.
Also by Little Bear Apps