Skip to content

Use standard Headers API instead of custom request context object #1300

Closed

Description

@felixweinberger

Summary

Replace custom request context objects with the standard web Headers API for better standards alignment and developer familiarity.

This was identified as a gap in the v2 wishlist (issue #809) that is not yet tracked as a separate issue.

Motivation

  • Standards alignment: The Headers API is a web standard that developers already know
  • Interoperability: Standard APIs work better across different runtimes (Node.js, Deno, Bun, browsers)
  • Developer experience: Familiar API reduces learning curve
  • Type safety: Headers has well-defined TypeScript types

Requirements

  1. Replace custom header/context objects with standard Headers API
  2. Update request context interfaces to use Headers
  3. Ensure compatibility with Node.js, Deno, Bun runtimes
  4. Provide migration guidance for existing code

API Changes

// Before (custom object)
interface RequestContext {
  headers: Record<string, string>;
  // ...
}

// After (standard Headers)
interface RequestContext {
  headers: Headers;
  // ...
}

Related Issues

Activity

  1. added
    enhancementRequest for a new feature that's not currently supported
    breaking changeWill break existing deployments when updated without changes
    v2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
    ready for workEnough information for someone to start working on
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Dec 15, 2025
  2. linked a pull request that will close this issue[v2] move to Headers object #1327on Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Moderate issues affecting some users, edge cases, potentially valuable featurebreaking changeWill break existing deployments when updated without changesenhancementRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions