Skip to content

docs: say "connector token" and "web calling token" throughout - #31

Merged
Zakariya1057 merged 1 commit into
mainfrom
docs/token-terminology
Jul 20, 2026
Merged

docs: say "connector token" and "web calling token" throughout#31
Zakariya1057 merged 1 commit into
mainfrom
docs/token-terminology

Conversation

@Zakariya1057

Copy link
Copy Markdown
Collaborator

Picks one name per credential across docs, examples, and the SDK's user-facing copy.

What changed

Old New
"API key" (prose) connector token
"WebRTC token" / "gateway token" web calling token
YOUR_API_KEY YOUR_CONNECTOR_TOKEN
YOUR_WEBRTC_TOKEN YOUR_WEB_CALLING_TOKEN

Two deliberate limits

No public API symbols were renamed. Configuration.apiKey and VoiceOptions.webrtcToken are byte-identical, so this is not a breaking change and every snippet still compiles. 72b54a9 settled that surface for 0.9.0 and this doesn't reopen it.

The tradeoff worth reviewing: prose now reads "connector token" next to a symbol still called apiKey. Renaming the symbols would be a separate, breaking PR — flagging it rather than deciding it here.

"WebRTC" the protocol is untouched. Only the credential was renamed. "WebRTC media", "the WebRTC binary", the xcframework, WebRTC-lib, "WebRTC audio engine" all stay — those are factual, and renaming them would turn correct docs into wrong ones.

Why "connector token" and not just "token"

A voice call takes two tokens, and the docs exist largely to tell them apart — a bare "token" would be ambiguous exactly where clarity matters most. This also isn't a new coinage: README.md and docs/PolyVoice.md already annotated their snippets // connector token, and scripts/e2e-validation.sh already reads POLY_CONNECTOR_TOKEN. This finishes a migration that was already half-done.

One thing that would have broken silently

scripts/e2e-validation.sh substitutes YOUR_API_KEY into the example apps at test time. Renaming the placeholder without updating the script would have left an unsubstituted placeholder in the built examples and failed authentication at runtime — updated in the same commit.

Placeholders are changed in both the READMEs and the example .swift sources, since the READMEs say currently "YOUR_..." and would otherwise drift.

Also swept

User-facing SDK copy that would have contradicted the new docs:

  • PolyError.swift — "Your API key was rejected" → "Your connector token was rejected"
  • SessionState.swift — "Invalid API key" → "Invalid connector token"
  • PolyMessaging.swift — the initialize() fatalError hint
  • /// doc comments across Sources/ (these render into DocC)
  • One test assertion in PolyErrorDescriptionTests.swift that pinned the old wording

Verification

  • swift build clean
  • 283 tests pass, 0 failures
  • Every non-comment change in Sources/ is one of the user-facing strings listed above — audited via diff
  • Zero remaining YOUR_API_KEY / YOUR_WEBRTC_TOKEN; zero accidental connectorToken: / webCallingToken: symbol renames

Follow-up left open

VoiceOptions.swift documents a "WebRTC gateway host" — a host, not a credential, so it was left under the protocol rule. It now sits near "web calling token" and reads slightly inconsistently. Worth a naming decision, not made here.

Settles on one name per credential across the docs, examples, and the
SDK's user-facing copy.

- "API key" -> "connector token" in prose. The repo had already started
  this migration (README/PolyVoice.md snippets were annotated
  "// connector token", and e2e-validation.sh reads POLY_CONNECTOR_TOKEN),
  so this finishes it. Uses "connector token" rather than a bare "token"
  because a voice call takes two tokens and the docs are trying to tell
  them apart.
- "WebRTC token" -> "web calling token", for the credential ONLY. Every
  reference to WebRTC-the-protocol or the WebRTC dependency (media,
  binary, xcframework, audio engine, WebRTC-lib) is left alone -- those
  are factual and renaming them would make correct docs wrong.
- A third name for the same credential ("gateway token") is folded into
  "web calling token".
- Placeholders: YOUR_API_KEY -> YOUR_CONNECTOR_TOKEN, YOUR_WEBRTC_TOKEN
  -> YOUR_WEB_CALLING_TOKEN, in both the READMEs and the example sources
  so they can't drift. scripts/e2e-validation.sh substitutes
  YOUR_API_KEY at test time and is updated to match -- without that, e2e
  would have built the examples with an unsubstituted placeholder.
- User-facing SDK copy that contradicted the new docs: PolyError's
  "Your API key was rejected", SessionState's "Invalid API key", and the
  initialize() fatalError hint.

No public API symbols were renamed. Configuration.apiKey and
VoiceOptions.webrtcToken are untouched, so this is not a breaking change
and every snippet still compiles -- 72b54a9 settled that surface for
0.9.0 and this does not reopen it. The tradeoff is that prose now says
"connector token" next to a symbol still called apiKey; renaming the
symbols would be a separate, breaking PR.

swift build clean; 283 tests pass.
@Zakariya1057
Zakariya1057 merged commit 67e739d into main Jul 20, 2026
4 checks passed
@Zakariya1057
Zakariya1057 deleted the docs/token-terminology branch July 20, 2026 20:53
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