Skip to main content
@rewritetoday/rest is the low-level Rewrite API client for teams that need direct control over HTTP behavior. Repository: github.com/RewriteToday/rest

When to use it

  • You want explicit request/response control.
  • You need custom retry or timeout behavior.
  • You run in serverless/edge workers and need strict execution budgets.
  • You already have your own abstraction layer and only need transport primitives.

Key capabilities

Route helpers

Use route builders from @rewritetoday/types to avoid path construction mistakes.

Retry controls

Handle transient failures and rate-limit responses with custom backoff logic.

Timeout strategy

Configure request timeout budgets that fit your runtime constraints.

Hooks

Add observability, custom logging, or request/response instrumentation.

Install

Basic example

Resilience example

Best practices

Never expose Rewrite API keys in frontend bundles, mobile binaries, or public repositories.
Include idempotency keys for create/send actions to avoid accidental duplicates during retries.
Pair @rewritetoday/rest with @rewritetoday/types to keep paths and payload contracts synchronized.
Log latency, status classes, and retry counts to detect saturation and provider instability.

Types library

Route builders, shared contracts, and enums used together with REST.

Errors and retries

Retry guidance, timeout strategy, and failure-handling patterns.