restream-sdk 0.1.5 → 0.1.6

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.5",
3
+ "version": "0.1.6",
4
4
  "description": "Plug-and-play headless React hooks to add multi-platform restreaming (connect socials, go live, live chat + viewers) with zero client backend.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/core.js CHANGED
@@ -4,7 +4,7 @@
4
4
  // (publisherSessionId) is produced by the client's existing stream and passed
5
5
  // into goLive() — this module never captures or publishes media itself.
6
6
 
7
- export const PLATFORMS = ["twitch", "kick", "youtube", "facebook", "instagram", "tiktok"];
7
+ export const PLATFORMS = ["twitch", "kick", "youtube", "facebook", "instagram", "tiktok", "restream"];
8
8
 
9
9
  const TERMINAL_STATUS = new Set(["stopped", "failed", "ended", "error", "completed"]);
10
10
 
@@ -293,8 +293,11 @@ export class RestreamStudio extends EventTarget {
293
293
  * @param {object} [opts.overlay] { topBanner?, bottomBanner?, htmlBanner?, enabled? }
294
294
  * @param {boolean} [opts.recording]
295
295
  * @param {string[]} [opts.trackNames] tracks actually published, e.g. ["audio","video"]
296
+ * @param {object} [opts.streamMeta] { title?, description?, tags?:string[] } applied to
297
+ * Restream channels. Any field omitted falls back to the
298
+ * default pre-set for this creator on the platform.
296
299
  */
297
- async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels } = {}) {
300
+ async goLive({ publisherSessionId, destinations, overlay, recording, trackNames, restreamChannels, streamMeta } = {}) {
298
301
  if (!publisherSessionId) throw new Error("publisherSessionId is required (from your existing stream session)");
299
302
  const body = {
300
303
  publisherSessionId,
@@ -305,6 +308,11 @@ export class RestreamStudio extends EventTarget {
305
308
  if (trackNames && trackNames.length) body.trackNames = trackNames;
306
309
  // Per-platform selection for the "restream" fan-out bridge (channel ids or platform names).
307
310
  if (restreamChannels && restreamChannels.length) body.restreamChannels = restreamChannels;
311
+ // Stream title/description/tags. Send only what you have — omitted fields fall
312
+ // back to the creator's pre-set default on the platform.
313
+ if (streamMeta && (streamMeta.title || streamMeta.description || (streamMeta.tags && streamMeta.tags.length))) {
314
+ body.streamMeta = streamMeta;
315
+ }
308
316
  if (this.publishableKey && this.userId) body.clientUserId = this.userId; // token mode binds server-side
309
317
  const job = await this._req("POST", "/api/v1/jobs", body);
310
318
  this.job = job;
package/types/index.d.ts CHANGED
@@ -75,6 +75,18 @@ export interface GoLiveParams {
75
75
  * Omit to use whichever channels are currently active in the Restream account.
76
76
  */
77
77
  restreamChannels?: string[];
78
+ /**
79
+ * Stream title / description / tags applied to the Restream channels. Send only
80
+ * the fields you have — any field you omit falls back to the default pre-set for
81
+ * this creator on the platform. Omit entirely to use the pre-set defaults.
82
+ */
83
+ streamMeta?: StreamMeta;
84
+ }
85
+
86
+ export interface StreamMeta {
87
+ title?: string;
88
+ description?: string;
89
+ tags?: string[];
78
90
  }
79
91
 
80
92
  export interface OverlayUpdate {