@fishjam-cloud/react-client 0.26.3 → 0.27.0-rc.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.
@@ -1,10 +1,8 @@
1
1
  export type UseSandboxProps = {
2
- configOverride?: {
3
- sandboxApiUrl?: string;
4
- };
2
+ sandboxApiUrl: string;
5
3
  };
6
4
  export type RoomType = "conference" | "livestream" | "audio_only";
7
- export declare const useSandbox: (props?: UseSandboxProps) => {
5
+ export declare const useSandbox: (props: UseSandboxProps) => {
8
6
  getSandboxPeerToken: (roomName: string, peerName: string, roomType?: RoomType) => Promise<string>;
9
7
  getSandboxViewerToken: (roomName: string) => Promise<string>;
10
8
  getSandboxLivestream: (roomName: string, isPublic?: boolean) => Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"useSandbox.d.ts","sourceRoot":"","sources":["../../src/hooks/useSandbox.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,eAAe,GAAG;IAE5B,cAAc,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAElE,eAAO,MAAM,UAAU,GAAI,QAAQ,eAAe;oCAQ7B,MAAM,YAAY,MAAM,aAAY,QAAQ;sCAoB5C,MAAM;qCAmBN,MAAM,aAAY,OAAO;uBAQX,MAAM;cAAQ;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE;;CAO5E,CAAC"}
1
+ {"version":3,"file":"useSandbox.d.ts","sourceRoot":"","sources":["../../src/hooks/useSandbox.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAElE,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe;oCAQ5B,MAAM,YAAY,MAAM,aAAY,QAAQ;sCAoB5C,MAAM;qCAmBN,MAAM,aAAY,OAAO;uBAQX,MAAM;cAAQ;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE;;CAO5E,CAAC"}
@@ -1,10 +1,9 @@
1
1
  import { useCallback } from "react";
2
- import { useFishjamId } from "../contexts/fishjamId";
3
- import { resolveFishjamUrl } from "../utils/fishjamUrl";
4
2
  export const useSandbox = (props) => {
5
- const fishjamId = useFishjamId();
6
- const fishjamUrl = resolveFishjamUrl(fishjamId);
7
- const sandboxApiUrl = props?.configOverride?.sandboxApiUrl ?? `${fishjamUrl}/room-manager`;
3
+ const sandboxApiUrl = props?.sandboxApiUrl;
4
+ if (!sandboxApiUrl) {
5
+ throw new Error("useSandbox requires a sandboxApiUrl, you can get it at: https://fishjam.io/app/sandbox");
6
+ }
8
7
  const getSandboxPeerToken = useCallback(async (roomName, peerName, roomType = "conference") => {
9
8
  const url = new URL(sandboxApiUrl);
10
9
  url.searchParams.set("roomName", roomName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishjam-cloud/react-client",
3
- "version": "0.26.3",
3
+ "version": "0.27.0-rc.0",
4
4
  "description": "React client library for Fishjam",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Fishjam Team",
@@ -62,7 +62,7 @@
62
62
  "vitest": "^3.1.1"
63
63
  },
64
64
  "dependencies": {
65
- "@fishjam-cloud/ts-client": "0.26.3",
65
+ "@fishjam-cloud/ts-client": "0.27.0-rc.0",
66
66
  "events": "3.3.0",
67
67
  "lodash.isequal": "4.5.0"
68
68
  },
@@ -77,5 +77,6 @@
77
77
  "*.(js|ts|tsx)": [
78
78
  "yarn lint"
79
79
  ]
80
- }
80
+ },
81
+ "stableVersion": "0.26.3"
81
82
  }