Skip to content

Rewrite composition docs around the server SDKs - #286

Merged
Gawor270 merged 10 commits into
mainfrom
fce-3731
Sep 14, 2026
Merged

Gawor270 merged 10 commits into
mainfrom
fce-3731

Conversation

@Gawor270

Copy link
Copy Markdown
Member

Composition docs now show the JS and Python server SDKs, with curl kept as the last tab.

  • Add Typescript and Python tabs to all 29 composition API calls across 7 pages
  • Bump js-server-sdk and python-server-sdk submodules to v0.30.2, which ship CompositionClient
  • Name SDK methods in prose instead of raw endpoints, and map each input and output type to its method
  • Inline https://rtc.fishjam.io in curl instead of a $COMPOSITION_URL variable
  • Put Typescript first in record-a-composition, which was the only page defaulting to curl
  • Replace the hand-rolled FormData upload with registerTemplateOutput
  • Leave the tutorial's Step 3 on the Sandbox API, the only way to name a livestream

Composition support ships in 0.30.2 on both npm and PyPI. The pinned
0.29.0 predates CompositionClient and createRecording, so twoslash
failed to typecheck any snippet using them.
Add Typescript and Python tabs to every request, name SDK methods
instead of raw endpoints in prose, and map each input and output type
to its method in the tables.
The host is the same for every reader and the SDK tabs never set it,
so a shell variable made curl look like it needed setup the other
tabs did not.
registerTemplateOutput replaces the hand-rolled FormData fetch, and the
JavaScript tab becomes a Typescript one so it joins the shared language
tab group.
forwardRoomTracks pairs with compositionUrl, and the livestream WHIP
address and streamer token come from the client instead of the
placeholders curl needs.
Step 1 had no SDK tab, and this was the only page where curl was the
default tab in the shared language group.
Step 3 stays on the Sandbox API, which is the only way to give a
livestream the name the Step 5 viewer looks it up by.
@linear

linear Bot commented Sep 14, 2026

Copy link
Copy Markdown

FCE-3731

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The primary tutorial’s Python and TypeScript snippets reference environment variables that its setup never exports.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds server SDK examples throughout the composition documentation while retaining curl alternatives.

Changes:

  • Adds TypeScript and Python tabs for composition workflows.
  • Uses SDK method names and registerTemplateOutput.
  • Replaces $COMPOSITION_URL with the hosted API URL.
File summaries
File Description
docs/tutorials/compositions.mdx Adds SDK examples to the end-to-end tutorial.
docs/how-to/compositions/write-and-deploy-a-template.mdx Documents SDK-based template deployment.
docs/how-to/compositions/record-a-composition.mdx Adds SDK output-registration guidance.
docs/how-to/compositions/inputs-and-outputs.mdx Maps protocols and operations to SDK methods.
docs/how-to/compositions/drive-a-template-with-events.mdx Adds SDK examples for events and lifecycle management.
docs/how-to/compositions/compose-a-fishjam-room.mdx Adds SDK examples for room composition.
docs/explanation/compositions.mdx Shows SDK-based composition cleanup.
Review details

Suppressed comments (2)

docs/tutorials/compositions.mdx:83

  • The tutorial exports TOKEN, not MANAGEMENT_TOKEN, so this raises KeyError before the first Python API call. Use the environment variable established by the setup block.
    management_token=os.environ["MANAGEMENT_TOKEN"],

docs/tutorials/compositions.mdx:514

  • Neither FISHJAM_ID nor MANAGEMENT_TOKEN is exported by this tutorial's setup (FISHJAM_URL and TOKEN are), so the Python cleanup path raises KeyError. Use the configured token and an explicit Fishjam ID placeholder.
    fishjam_id=os.environ["FISHJAM_ID"],
    management_token=os.environ["MANAGEMENT_TOKEN"],
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/tutorials/compositions.mdx Outdated
The setup block exports TOKEN, so process.env.MANAGEMENT_TOKEN was
undefined. Take the token from a bare variable, as the other pages do.
@Gawor270
Gawor270 requested a review from czerwiukk September 14, 2026 11:44

@czerwiukk czerwiukk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@Gawor270
Gawor270 merged commit b7705ac into main Sep 14, 2026
1 check passed
@Gawor270
Gawor270 deleted the fce-3731 branch September 14, 2026 12:16
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.

3 participants