restream-sdk 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "restream-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Plug-and-play headless React hooks to add multi-platform restreaming (connect socials, go live, live chat + viewers, collaborative split-screen) with zero client backend.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/core.js CHANGED
@@ -400,7 +400,7 @@ export class RestreamStudio extends EventTarget {
400
400
  * Restream channels. Any field omitted falls back to the
401
401
  * default pre-set for this creator on the platform.
402
402
  */
403
- async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels, streamMeta, destinationMeta, streamingProvider, layout, screenSessionId } = {}) {
403
+ async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels, streamMeta, destinationMeta, streamingProvider, layout, screenSessionId, participantOnly } = {}) {
404
404
  if (!publisherSessionId) throw new Error("publisherSessionId is required (from your existing stream session)");
405
405
  const body = {
406
406
  publisherSessionId,
@@ -408,6 +408,10 @@ export class RestreamStudio extends EventTarget {
408
408
  overlay,
409
409
  recording,
410
410
  };
411
+ // Compositing-only participant (e.g. a collab challenger with no socials): go live with NO
412
+ // destinations. The job reaches 'running' — discoverable as an activeSoloJob so a per-creator
413
+ // collab can composite its camera — but fans out nowhere. Only forwarded when true.
414
+ if (participantOnly) body.participantOnly = true;
411
415
  if (trackNames && trackNames.length) body.trackNames = trackNames;
412
416
  // Per-platform selection for the "restream" fan-out bridge (channel ids or platform names).
413
417
  if (restreamChannels && restreamChannels.length) body.restreamChannels = restreamChannels;
@@ -523,10 +527,11 @@ export class RestreamStudio extends EventTarget {
523
527
 
524
528
  /**
525
529
  * Start screen sharing: capture the screen and publish it as its OWN Cloudflare Realtime
526
- * session (a separate LAYER from the camera). Returns { sessionId, trackName } pass the
527
- * sessionId to goLive({ screenSessionId }) (or updateScreenLayer() while live) so the backend
528
- * composites screen + camera server-side via the template. Restream-only; not shown in the
529
- * client's own player. Must be called from a user gesture (getDisplayMedia requires it).
530
+ * session (a separate LAYER from the camera). Returns { sessionId, trackName }. Also calls
531
+ * setStreamState({ screenShare: true, screenSessionId, screenTrackName }) for you, so the backend
532
+ * composites screen + camera server-side (solo screen_camera, collab collab_screen) at
533
+ * go-live if called first, or LIVE mid-stream via the layout transition. Restream-only; not shown
534
+ * in the client's own player. Must be called from a user gesture (getDisplayMedia requires it).
530
535
  *
531
536
  * @param {object} [opts] { trackName='screen', audio=false }
532
537
  * @returns {Promise<{sessionId:string, trackName:string}>}
package/types/index.d.ts CHANGED
@@ -107,6 +107,12 @@ export interface GoLiveParams {
107
107
  /** Cloudflare session of a screen-share publish (from startScreenShare) to composite as a
108
108
  * separate layer. Defaults to the SDK's active screen share if omitted. */
109
109
  screenSessionId?: string;
110
+ /**
111
+ * Compositing-only participant: go live with NO destinations. The job reaches `running` (so it's
112
+ * discoverable as an active solo job for a per-creator collab to composite its camera) but fans
113
+ * out nowhere. For a collab participant with no socials of their own (e.g. a challenger).
114
+ */
115
+ participantOnly?: boolean;
110
116
  }
111
117
 
112
118
  export interface StreamMeta {