restream-sdk 0.1.7 → 0.1.8

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.1.7",
3
+ "version": "0.1.8",
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
@@ -299,7 +299,7 @@ export class RestreamStudio extends EventTarget {
299
299
  * Restream channels. Any field omitted falls back to the
300
300
  * default pre-set for this creator on the platform.
301
301
  */
302
- async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels, streamMeta } = {}) {
302
+ async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels, streamMeta, destinationMeta } = {}) {
303
303
  if (!publisherSessionId) throw new Error("publisherSessionId is required (from your existing stream session)");
304
304
  const body = {
305
305
  publisherSessionId,
@@ -315,6 +315,12 @@ export class RestreamStudio extends EventTarget {
315
315
  if (streamMeta && (streamMeta.title || streamMeta.description || (streamMeta.tags && streamMeta.tags.length))) {
316
316
  body.streamMeta = streamMeta;
317
317
  }
318
+ // Per-destination overrides, keyed by platform name (e.g. { youtube: {title},
319
+ // twitch: {title, tags} }). Each field falls back to streamMeta, then the
320
+ // creator's pre-set per-destination / global default on the platform.
321
+ if (destinationMeta && typeof destinationMeta === "object" && Object.keys(destinationMeta).length) {
322
+ body.destinationMeta = destinationMeta;
323
+ }
318
324
  if (this.publishableKey && this.userId) body.clientUserId = this.userId; // token mode binds server-side
319
325
  const job = await this._req("POST", "/api/v1/jobs", body);
320
326
  this.job = job;
package/types/index.d.ts CHANGED
@@ -81,6 +81,13 @@ export interface GoLiveParams {
81
81
  * this creator on the platform. Omit entirely to use the pre-set defaults.
82
82
  */
83
83
  streamMeta?: StreamMeta;
84
+ /**
85
+ * Per-destination overrides, keyed by platform name (e.g.
86
+ * `{ youtube: { title }, twitch: { title, tags } }`). Each field falls back, in
87
+ * order, to: this map → `streamMeta` → the creator's pre-set per-destination
88
+ * default → the creator's pre-set global default → the platform's existing value.
89
+ */
90
+ destinationMeta?: DestinationMeta;
84
91
  }
85
92
 
86
93
  export interface StreamMeta {
@@ -89,6 +96,9 @@ export interface StreamMeta {
89
96
  tags?: string[];
90
97
  }
91
98
 
99
+ /** Per-platform stream metadata overrides, keyed by platform name. */
100
+ export type DestinationMeta = Partial<Record<Platform, StreamMeta>> & Record<string, StreamMeta>;
101
+
92
102
  export interface OverlayUpdate {
93
103
  topBanner?: string;
94
104
  bottomBanner?: string;