Years of backend experience, built into a resilience platform
BackendKit Labs is a production-grade open-source ecosystem of libraries focused on resilience, observability, operational security, and backend platform for Node.js, NestJS, and distributed systems.
Not a simple collection of isolated utilities — a cohesive technical platform where every library works in concert to strengthen the reliability of microservices, APIs, and distributed architectures.
Why BackendKit was born
Building robust, resilient, and maintainable backend applications is hard — not because tools are missing, but because the Node.js ecosystem offers loose pieces that require experience to choose, integrate, and operate correctly in production.
BackendKit Labs was born from a real need: a unified collection of libraries that solve the critical day-to-day problems of modern backend systems.
The goal is not "having utilities" — it is building reliable systems.
Philosophy
Five principles guide every design decision across the entire ecosystem.
Quick start
The fastest way to see BackendKit in action: a resilient payment charge that combines result, circuit-breaker, and http-client in under 40 lines — with zero try/catch and every error case typed and explicit at the call site.
import { ok, fail, type Result } from '@backendkit-labs/result'; import { CircuitBreaker } from '@backendkit-labs/circuit-breaker'; import { HttpClient } from '@backendkit-labs/http-client'; // One shared circuit breaker instance for the payment gateway const breaker = new CircuitBreaker({ name: 'stripe', failureThreshold: 40, // open after 40 % infra failures cooldownMs: 30_000, // card_declined is a business error — it must NOT open the circuit isFailure: (err) => err.status >= 500 || err.type === 'network_error', }); const stripe = new HttpClient({ baseUrl: 'https://api.stripe.com/v1', timeout: 10_000, retry: { attempts: 2, baseDelay: 500 }, }); async function chargeCard( amountCents: number, paymentMethodId: string, ): Promise<Result<PaymentIntent, ChargeError>> { return breaker.execute(() => stripe.post<PaymentIntent>('/payment_intents', { amount: amountCents, currency: 'usd', payment_method: paymentMethodId, confirm: true, }), ); } // Caller — no try/catch, no surprise exceptions, no unknown error shapes const result = await chargeCard(4999, 'pm_card_visa'); if (result.ok) { return { chargeId: result.value.id }; } // TypeScript narrows the union — every case is explicit switch (result.error.type) { case 'circuit_open': throw new ServiceUnavailableException(); case 'http_error': throw new UnprocessableEntityException(result.error.body); case 'network_error': throw new BadGatewayException(); }
Installation
All packages are published under the @backendkit-labs scope on npm. Install only what you need — each package has a zero-dependency core.
# Install only what you need npm install @backendkit-labs/result npm install @backendkit-labs/circuit-breaker npm install @backendkit-labs/bulkhead npm install @backendkit-labs/pipeline # With required peer deps npm install @backendkit-labs/http-client axios npm install @backendkit-labs/observability
NestJS integration is available via /nestjs subpath exports on every package that supports it. No extra packages needed.
What's included
Eight production-ready packages, each solving a distinct problem — and designed to compose naturally with each other.
Eliminate silent error paths forever. Result<T, E> makes every failure explicit in the type signature, composable with map/flatMap, and zero-overhead — no exceptions, no surprises.
Protect your services from cascading failures. Sliding-window failure tracking with configurable thresholds, half-open probing, and intelligent error classification.
Four algorithms, one interface. Starts in-memory with zero dependencies — swap to Redis without changing application code. Atomic Lua scripts guarantee correctness across multiple instances. Optional circuit breaker fallback keeps limits enforced even when Redis is down.
Borrowed from naval architecture: isolate compartments so one breach does not sink the ship. Limit concurrent calls per service, queue excess, reject when full.
Never write a retry loop again. retry() returns Result<T, RetryError> and handles exponential backoff with jitter, per-attempt and global timeouts, sliding-window retry budgets, duck-typed circuit breaker and bulkhead integration, and lifecycle hooks for observability.
Compose complex async workflows as a sequence of typed steps. Each handler receives the typed context, returns a Result, and the pipeline handles routing, early-exit, and error aggregation.
The HTTP client your services actually need. Built on axios with automatic retry with exponential backoff, integrated circuit breaker, structured error types, and every response as Result<T, HttpClientError>.
Closes the feedback loop. Observes every request, detects anomalies with z-score analysis, and automatically adjusts your circuit breaker thresholds, bulkhead concurrency, and HTTP timeouts — no ML, no guesswork.
Drop-in observability for NestJS. Winston-based structured logs, Prometheus metrics, automatic correlation IDs injected into every log line, and OpenTelemetry span propagation.
Defend at the edge. Scans every incoming request for SQL injection, XSS, Path Traversal, NoSQL injection, and SSRF patterns. Configurable severity levels, allow-lists, and NestJS guard integration.
The real differential
The true difference is not in any individual library.
It is that they work as an ecosystem.
These are not isolated pieces — they are a complete strategy for building serious backends. That turns libraries into a platform. That turns utilities into architecture.
Who it's for
Current state
Libraries are at initial versions and are targeting real production use. The goal is not simply to publish packages — it is to build a solid reference for modern backend architecture.
If you build backend, build with BackendKit.
Created by Mairon José Cuello Martínez — turning years of distributed backend experience into reusable, consistent, production-ready tools.