@upstash/context7-sdk@0.4.0

upstash/context7@upstash/context7-sdk@0.4.0Sep 7, 2026by github-actions[bot]

AI Summary

This release focuses on enhancing HTTP control and error handling within the SDK. It introduces production-grade HTTP controls like timeouts and retries, improves response type inference for runtime formats, and adds a structured error object with detailed metadata.

Key Highlights

  • Added production HTTP controls (timeouts, retries, abort signals, fetch cache).
  • Enhanced error handling with structured `Context7Error` fields (status, code, request ID, etc.).
  • Fixed response type inference for runtime-selected formats.
  • Default timeout set to 30 seconds with option to disable.

New Features

  • Client and per-request timeouts
  • Configurable transient HTTP retries
  • Native fetch cache settings
  • Custom fetch/base URL/header/keepalive support
  • URL validation
  • Response metadata hooks
  • Structured `Context7Error` fields

Full Release Notes

### Minor Changes

- 4eff2b9: Fix response type inference for runtime-selected formats, honor disabled retries, and separate deterministic SDK tests from live API integration tests. Calls that forward options whose response format is selected at runtime now correctly return an array-or-string union and may require result narrowing.

  Add production HTTP controls while keeping API-key authentication required: client and per-request timeouts, abort signals, configurable transient HTTP retries, native fetch cache settings, custom fetch/base URL/header/keepalive support, URL validation, response metadata hooks, and structured `Context7Error` fields for status, code, request ID, rate limits, retryability, malformed JSON, and cause.

  Requests now time out after 30 seconds by default. Set `timeout: false` on the client or an individual request to disable the timeout.