Conversation
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.
Contributor
There was a problem hiding this comment.
🟡 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_URLwith 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, notMANAGEMENT_TOKEN, so this raisesKeyErrorbefore 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_IDnorMANAGEMENT_TOKENis exported by this tutorial's setup (FISHJAM_URLandTOKENare), so the Python cleanup path raisesKeyError. 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.
The setup block exports TOKEN, so process.env.MANAGEMENT_TOKEN was undefined. Take the token from a bare variable, as the other pages do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Composition docs now show the JS and Python server SDKs, with curl kept as the last tab.
js-server-sdkandpython-server-sdksubmodules to v0.30.2, which shipCompositionClienthttps://rtc.fishjam.ioin curl instead of a$COMPOSITION_URLvariablerecord-a-composition, which was the only page defaulting to curlFormDataupload withregisterTemplateOutput