Skip to content

Replace Realtime SDK examples with Server SDK usage on four pages - #874

Merged
Devon-White merged 4 commits into
mainfrom
devon/remove-realtime-sdk-examples
Oct 29, 2026
Merged

Devon-White merged 4 commits into
mainfrom
devon/remove-realtime-sdk-examples

Conversation

@Devon-White

@Devon-White Devon-White commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes the remaining old Relay Realtime SDK (@signalwire/realtime-api) usage from four pages and replaces it with the current Server SDKs. Part of #600; the TTS provider pages and the BYOC page are in separate PRs, and the glossary's Realtime SDK entry stays as the definition of the legacy name.

  • Messaging overview (messaging/sms/overview.mdx): the four "Relay Realtime SDK (Server)" tabs become "WebSocket (Relay)" tabs with Python and TypeScript Relay client samples. Send SMS and send MMS use send_message / sendMessage and wait for a final state. Respond and forward use an on_message / onMessage handler on the office topic, with one sentence saying how texts reach that topic. Only the tab contents changed, so this merges cleanly with Add send and receive messages guide #819 (checked with git merge-tree).
  • API credentials (platform/setup/api-credentials.mdx): the Realtime Video.Client block is replaced by the Server SDKs' REST client listing video rooms (client.video.rooms.list()). These come first as two new tabs ahead of the existing cURL and Node.js tabs. The Server SDKs have no Relay video client, so this uses the REST endpoint the page was already demonstrating (GET /api/video/rooms). I removed the sentence "you are not required to pass the Space URL when working with the SDK" because the REST client takes host.
  • Deploy SWML (swml/guides/basics/deployment.mdx): the Voice.Client + raw calling.transfer snippet becomes a Relay client handler that calls call.transfer(script) with the same inline YAML document. The prose no longer uses the editorial "we" or names client.execute, and its link now points to /docs/server-sdks instead of the Python Relay reference.
  • Chat overview (messaging/chat/overview.mdx): the SMS FAQ now says to pair Chat with Messaging through the Server SDKs, linking /docs/server-sdks.

Verification

  • Installed signalwire-sdk==3.4.1 (venv) and @signalwire/sdk@2.0.5 (npm) in a scratch dir outside the repo. Checked every method, parameter, and field against the installed source and type declarations:

    • Python: RelayClient(project, token, contexts), async with, send_message(from_number, to_number, body | media), Message.wait(timeout), .state, @client.on_message with message.from_number / to_number / body, @client.on_call, Call.transfer(dest), client.run(), and RestClient(...).video.rooms.list().
    • TypeScript: sendMessage({ fromNumber, toNumber, body | media }), message.wait(seconds), onMessage, onCall, call.transfer(dest), connect / disconnect / run, and RestClient(...).video.rooms.list().
  • Extracted every new sample. Python passes py_compile and pyflakes. TypeScript passes tsc --strict --noEmit against the installed @signalwire/sdk@2.0.5. The inline SWML YAML parses.

  • Inline SWML as a Relay transfer dest: confirmed in the platform's Relay transfer handling that dest may be an HTTPS URL or an inline JSON/YAML SWML document, which is what the old sample relied on.

  • yarn fern-md-check: all MDX files valid.

  • Links touched: /docs/server-sdks (product root) and /docs/platform/messaging (existing). No anchors added.

  • Prose scan: no language names or per-language method names outside code block titles and code.

  • Review follow-up: Relay Application links to the glossary on the SMS overview and Deploy SWML pages; the SMS overview explains its placeholders and links API credentials; the API credentials REST client samples sit under one Server SDKs tab; the Axios tab drops the editorial "we" and uses <space-name> in its URL.

Notes for reviewers

  • I didn't run the samples against a live Space, so delivery and transfer at runtime are unverified.
  • Dashboard labels in the new sentences (Inbound Message Settings, Inbound Call Settings, Relay Application topic) are taken from the current calling guide and Add send and receive messages guide #819. I didn't check them in a live Dashboard.
  • Upstream doc inconsistency, not changed here: the Server SDK transfer reference pages say dest can be "a Relay context name or a URL pointing to a SWML script". The platform's handling routes dest through SWML document fetching, where a bare word is treated as a section name, not a Relay context. Worth a separate check.
  • The SMS overview samples now use a valid E.164 example number (+15551231234) in every tab, the REST tabs send from/to in the same direction as the SWML and Relay tabs, and the cURL samples authenticate with -u '<YOUR_PROJECT_ID>:<YOUR_API_TOKEN>' instead of a pre-encoded Basic auth string.

Preview

Closes #879
Refs #600

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

@Manny-r31 Manny-r31 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: minor fixes

CI is green, no conflicts. One should-fix, plus a few nits.

Should fix

  • Link Relay Application on first mention. It appears unlinked in the SMS overview (above the respond tab, and again further down) and in deployment.mdx (paragraph after the sample). Use [Relay Application](/docs/platform/glossary#relay-application). The anchor exists, and calling/whatsapp/receive-calls.mdx already links it this way.

Nits

  1. api-credentials.mdx: the tab titles "Python — REST client" and "TypeScript — REST client" borrow the code-block title format, but the em-dash exception covers code-block titles only. One option is a single REST client tab wrapping a <CodeBlocks> with the two titled CodeBlocks. Fine to keep if it's deliberate for consistency with the page.
  2. The SMS page introduces <YOUR_PROJECT_ID> / <YOUR_API_TOKEN> without saying where to find them, while api-credentials.mdx uses <Project ID> / <API token>. Consider aligning the placeholder style or adding a one-line pointer to the credentials page.
  3. Pre-existing text you didn't touch, flag only: the api-credentials Node.js tab still says "We use the external dependency", and its Axios URL uses <space name> (with a space). The SMS page's invalid E.164 numbers and the REST tab's to/from swap you already disclosed.

Verified

  • No em dashes in new prose, no "Call Fabric", no cXML/Compatibility API mentions.
  • /docs/server-sdks and /docs/platform/messaging resolve. "Inbound Message Settings" and "Inbound Call Settings" match existing pages.
  • Pinned versions and header comments follow mdx-capability-guides.
  • The SDK calls match the in-repo Server SDK reference: RelayClient(project, token, contexts), send_message(...), message.wait / .state, on_message / on_call, call.transfer(dest), client.run(), RestClient(host=...), and video.rooms.list().
  • Dropping "you are not required to pass the Space URL" is correct, since the REST client requires host.

Link Relay Application to the glossary, explain the SMS sample placeholders,
group the REST client samples under one Server SDKs tab, and tidy the
Axios tab on the API credentials page.
Use a valid example number, put from/to in the same order as the SWML and
Relay tabs, and authenticate the cURL samples with the Project ID and API
token placeholders the page explains.
@Devon-White
Devon-White merged commit 58db7b2 into main Oct 29, 2026
2 checks passed
@Devon-White
Devon-White deleted the devon/remove-realtime-sdk-examples branch October 29, 2026 12:46
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.

Replace Realtime SDK examples on the SMS overview, API credentials, SWML deployment, and Chat overview pages

2 participants