Index of every page on this site: llms.txt
All skills
software-mansion-labs avatar

/python-server-sdk

@43cde80
Run it yourself

Python server SDK for Fishjam — backends that create rooms, mint peer tokens, receive server notifications, and run voice agents. Use when writing a Python backend (FastAPI, Flask, Starlette, aiohttp) that talks to Fishjam, decorates a notification handler, decodes a Fishjam webhook, builds an AI voice agent, or composes streams in Python. Trigger on: 'fishjam-server-sdk', 'pip install fishjam-server-sdk', 'from fishjam import', 'fishjam.FishjamClient', 'FishjamNotifier', 'on_server_notification', 'receive_binary', 'fishjam Agent', 'AgentSession', 'PeerOptions', 'RoomOptions', 'AgentOptions', 'AgentOutputOptions', 'OutgoingAudioTrackOptions', 'create_room', 'create_peer', 'create_agent', 'create_vapi_agent', 'create_livestream_streamer_token', 'create_moq_token', 'subscribe_peer', 'fastapi fishjam', 'flask fishjam', 'fishjam python', 'gemini fishjam python', 'CompositionClient', 'forward_room_tracks'. Python 3.10+. The REST client is synchronous; notifier and agent are async.

  • 10 files
  • 55.7 KB
  • Apache-2
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/python-server-sdk

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

livestream-and-moq.md

≈732 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Livestream & MoQ Tokens (Python)

Three token types issued by FishjamClient for non-WebRTC-conference flows. All synchronous.

Livestream rooms

from fishjam import FishjamClient, RoomOptions

room = fishjam_client.create_room(RoomOptions(room_type='livestream'))
# or public (no viewer tokens needed):
room = fishjam_client.create_room(RoomOptions(room_type='livestream', public=True))

streamer_token = fishjam_client.create_livestream_streamer_token(room.id)
# → ship to the single broadcasting client

viewer_token = fishjam_client.create_livestream_viewer_token(room.id)
# → ship to each viewer (private livestreams only)

Public vs private

Mode public Viewer token?
Private (default) False required
Public True not used — viewers connect by room ID

public is set at room creation and is immutable for that room.

Constraints

  • One streamer per room. Issuing a second streamer token doesn't add a second broadcaster.
  • One video + one audio track on the streamer. Extra tracks dropped silently.

Revocation

Livestream streamer and viewer tokens issued via create_livestream_streamer_token(room_id) / create_livestream_viewer_token(room_id) cannot be revoked individually — there is no public REST endpoint or SDK method for it. To invalidate all outstanding tokens for a livestream room, call fishjam_client.delete_room(room_id).

MoQ tokens

publisher_token = fishjam_client.create_moq_token(publish_path='my-room/alice')
subscriber_token = fishjam_client.create_moq_token(subscribe_path='my-room')

Path scoping is prefix-based:

publish_path value Allows publishing to
'stream-name' Any path under stream-name/* — client picks identity
'stream-name/alice' Only the exact path stream-name/alice — identity pinned

Same for subscribe_path. Your Fishjam ID is the implicit root namespace; don't include it in the path.

The token is attached as ?jwt=<token> to https://relay.fishjam.io/<fishjam-id>?jwt=<token> (HTTPS bootstrap — MoQ runs over WebTransport/QUIC, not WebSocket). The Fishjam ID is the only URL path segment; the publish/subscribe path is encoded in the JWT.

See ../platform/room-types.md for MoQ conceptual overview.

Client-side counterpart

  • React web: ../react-client/livestream.md (uses useLivestreamStreamer / useLivestreamViewer).
  • React Native: ../react-native-client/SKILL.md (re-exports those hooks).
  • MoQ: no first-party React hook — use a MoQ-compatible JS library (@moq/publish, @moq/watch).

Sources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month

README badge

README badge for software-mansion-labs/skills/python-server-sdk