Skip to main content

Package shape

ByteKit is organized as a small set of public entrypoints. Each one maps to a focused area of responsibility.

Core entrypoints

ByteKit exposes a small set of focused entrypoints instead of one large monolith.

Networking and resilience

  • bytekit: convenience root export for the main modules
  • bytekit/api-client: ApiClient, ApiError, request types, list helpers
  • bytekit/retry-policy: RetryPolicy and CircuitBreaker
  • bytekit/response-validator: built-in validation utilities
  • bytekit/request-cache: in-memory request cache primitives
  • bytekit/request-deduplicator: deduplicate in-flight requests
  • bytekit/rate-limiter: token bucket and sliding-window rate limiting
  • bytekit/error-boundary: normalize and isolate errors
  • bytekit/schema-adapter: schema adapter helpers like zodAdapter and valibotAdapter

Async toolkit

  • bytekit/async: retry, parallel, sequential, race, allSettled, timeout, sleep, debounceAsync, throttleAsync

Observability

  • bytekit/logger: structured logs and logger factory helpers
  • bytekit/profiler: execution timing and performance measurement
  • bytekit/debug: debug helpers for development diagnostics

Helpers

  • bytekit/env-manager: environment-aware value lookup
  • bytekit/storage-utils: storage access helpers
  • bytekit/file-upload: multipart and upload helpers
  • bytekit/streaming: NDJSON, SSE, and streaming downloads
  • bytekit/websocket: typed WebSocket helper utilities
  • bytekit/cache-manager: broader cache strategies beyond request caching
  • bytekit/compression-utils: compression and decompression helpers
  • bytekit/crypto-utils: hashes, HMAC, UUIDs, and secure comparisons
  • bytekit/diff-utils: object and array diffing
  • bytekit/event-emitter: event bus primitives
  • bytekit/polling-helper: polling with configurable intervals and control

Choose by use case

If you need to…Use
Call REST endpoints with typed helpersApiClient
Retry flaky async code outside HTTPbytekit/async retry
Protect an unstable integrationRetryPolicy, CircuitBreaker, RateLimiter
Avoid duplicate in-flight callsRequestDeduplicator
Cache request results locallyRequestCache or CacheManager
Consume event streams or NDJSONStreamingHelper
Standardize logs across modulesLogger or createLogger
Use the narrowest public entrypoint that matches your use case.
import { ApiClient } from "bytekit/api-client";
import { retry, parallel } from "bytekit/async";
import { Logger } from "bytekit/logger";
If you prefer a single import surface, bytekit also re-exports the main modules.

Good defaults

  • Prefer bytekit/api-client and bytekit/async in application code when you want explicit module boundaries.
  • Prefer the root bytekit export in quick prototypes or small services.
  • Keep user-facing docs and examples on public package exports only.
Continue with Import paths for the exact public export map you can rely on.