Catalog npm
PACKAGE EXPLORERView in registry

@021.is/spine-http

npm

Typed HTTP client base with resilience defaults (timeout, retry, circuit-break). TS twin of a proven Kotlin REST kit.

Versions collected2
Direct dependencies1From release 0.4.3
Last observed20 Oct, 22:00 UTC

README

Current package documentation

@021.is/spine-http

Typed fetch client with resilience defaults: per-request timeout, retry on idempotent failures, circuit breaker per host. Auto-unwraps ResponseDto envelopes from sibling packages.

Use

import { SpineHttpClient } from "@021.is/spine-http";

const dcEvents = new SpineHttpClient({
  baseUrl: "https://api.example.com",
  timeoutMs: 1000,             // default
  retries: 1,                  // default — retries idempotent methods only
  failureThreshold: 5,         // default — open circuit after 5 fails in 10s
  windowMs: 10_000,
  defaultHeaders: { "x-service": "my-app" },
  authToken: async () => mintServiceJwt(), // optional
});

// Auto-unwraps ResponseDto<Event> if peer is your service
const event = await dcEvents.get<Event>(`/events/${id}`);

Resilience defaults (tuned for service-to-service)

DefaultTunable
Timeout per request1000 mstimeoutMs
Retries on GET/HEAD/PUT/DELETE1retries
Circuit-break threshold5 failures in 10sfailureThreshold, windowMs
Retries on POST/PATCH0 (POST is non-idempotent by default)—

Circuit behavior

After failureThreshold failures within windowMs, the circuit opens for the remainder of windowMs. New requests fail fast with circuit open — Xs remaining until the window expires, then probe-mode resumes.

ResponseDto unwrap

If peer returns { success, data, code, ... } shape (i.e., they use spine-errors), the client unwraps and returns data directly. If success: false, throws an Error carrying code + errorKey.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 2

Collected releases
VersionPublishedDirect dependenciesOpen version
0.4.3Registry latest28 May 20261
0.4.028 May 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
021is/spine-ts

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:00 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5ed51ceb012e472cb95f54936f2e95531a3815b78a218c968861989a1ed706c3