Skip to content

feat: send User-Agent header identifying SDK and version#4

Merged
Ooscaar merged 1 commit into
mainfrom
feat/user-agent-header
May 26, 2026
Merged

feat: send User-Agent header identifying SDK and version#4
Ooscaar merged 1 commit into
mainfrom
feat/user-agent-header

Conversation

@Ooscaar

@Ooscaar Ooscaar commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Sets User-Agent: @zernio/node/<version> on every outbound request, with the version pulled from package.json at build time.
  • Consumers can still override the header via defaultHeaders: { 'User-Agent': '...' } — the override applies after the default is set.
  • Adds two tests: one asserting the default UA is sent, one asserting it can be overridden.

Test plan

  • npx vitest run tests/client.test.ts — 16/16 pass
  • Verify on the API side that the new User-Agent shows up in request logs once a release goes out

@Ooscaar Ooscaar force-pushed the feat/user-agent-header branch 3 times, most recently from a505ef7 to c917d13 Compare May 26, 2026 07:03
Sends `User-Agent: zernio-node/<package version>` on every request so the
API can attribute traffic to the SDK. Applied via `client.setConfig`
(not the auth interceptor) and ported into `scripts/generate-client.ts`
so it survives `npm run generate` regeneration of `src/client.ts`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Ooscaar Ooscaar force-pushed the feat/user-agent-header branch from c917d13 to 983b245 Compare May 26, 2026 07:52
@Ooscaar Ooscaar merged commit 6e9ad7c into main May 26, 2026
1 check passed
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