Skip to content

feat: add fetch hook to add custom user agent#3

Open
nimarb wants to merge 2 commits intovercel-labs:mainfrom
nimarb:feat/main-fetch-hook
Open

feat: add fetch hook to add custom user agent#3
nimarb wants to merge 2 commits intovercel-labs:mainfrom
nimarb:feat/main-fetch-hook

Conversation

@nimarb
Copy link

@nimarb nimarb commented Feb 24, 2026

In our CLI, we want to inject request metadata (such as use agent strings / headers), without patching global fetch, which can become ugly.

therefore, we:

  • add fetch?: typeof fetch to main()
  • thread fetch through addGeneratedCommands into executeAction, so generated CLI commands use the
    provided fetch implementation.
  • add a test to validate that the fetch is honoured

NOTE: this PR includes my previous PR, let me know if i shall separate because one should be merged before the other. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant