Skip to content

SWI-11363 Send a User-Agent header on outbound Bandwidth requests#22

Open
kshahbw wants to merge 2 commits into
mainfrom
feat/bw-client-user-agent
Open

SWI-11363 Send a User-Agent header on outbound Bandwidth requests#22
kshahbw wants to merge 2 commits into
mainfrom
feat/bw-client-user-agent

Conversation

@kshahbw

@kshahbw kshahbw commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Adds a User-Agent header to every outbound Bandwidth request so BW can attribute traffic to this client and version.

What changed

  • New src/bw/user-agent.ts — exports USER_AGENT = \/`, read from package.json` at import time (stays in sync with the package version automatically).
  • src/bw/token.ts — sets User-Agent on the OAuth2 token exchange.
  • src/bw/client.ts — sets it on all six Voice API calls (createCall, modifyCall, getCall, listRecordings, getRecording, getRecordingMedia, updateRecording).

Verification

  • npm run typecheck clean
  • bw-client tests pass
  • Runtime check: USER_AGENT resolves to bw-voice-adapter/0.1.0 (becomes migration-toolkit/0.1.0 once the rebrand lands, since it reads package.json).

Independent of the Migration Toolkit rebrand PR — touches only src/bw/.

Add USER_AGENT (bw-voice-adapter/<version>, read from package.json at import
time) and set it on every outbound Bandwidth call — the OAuth2 token exchange
in token.ts and all six Voice API calls in client.ts. Lets Bandwidth attribute
outbound traffic to this client and version.
@kshahbw
kshahbw requested review from a team as code owners July 23, 2026 21:07
@bwappsec

bwappsec commented Jul 23, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@kshahbw kshahbw changed the title Send a User-Agent header on outbound Bandwidth requests SWI-11363 Send a User-Agent header on outbound Bandwidth requests Jul 24, 2026
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.

2 participants