restream-sdk 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/core.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "restream-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
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
@@ -489,7 +489,9 @@ export class RestreamStudio extends EventTarget {
489
489
  if (this._stateTimer) clearTimeout(this._stateTimer);
490
490
  this._stateTimer = setTimeout(() => {
491
491
  this._stateTimer = null;
492
- this._req("POST", `/api/v1/jobs/${jobId}/state`, this._streamState).catch((e) => this._emit("error", e));
492
+ // _withUser adds clientUserId (pk mode) so the server can attribute this update to the
493
+ // right half of a collab composite (host vs guest); no-op in token mode.
494
+ this._req("POST", `/api/v1/jobs/${jobId}/state`, this._withUser(this._streamState)).catch((e) => this._emit("error", e));
493
495
  }, 150);
494
496
  return this._streamState;
495
497
  }