Skip to content

Commit ab22955

Browse files
fix: update the mutation URL (#69)
1 parent 4026fc5 commit ab22955

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.changeset/light-laws-compete.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@sigmacomputing/react-embed-sdk": minor
3+
"@sigmacomputing/embed-sdk": minor
4+
---
5+
6+
Fix mutation URL to production

packages/embed-sdk/src/mutations.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,27 @@ import {
99
WorkbookVariablesUpdateEventName,
1010
} from "./types";
1111

12+
let SIGMA_COMPUTING_URL = "https://app.sigmacomputing.com";
13+
1214
const sendIframeMessage = (
1315
iframe: HTMLIFrameElement,
1416
message: { type: string; [key: string]: unknown },
1517
) => {
1618
if (!iframe.contentWindow) {
1719
throw new Error("iframe contentWindow is not available");
1820
}
19-
iframe.contentWindow.postMessage(
20-
message,
21-
"https://staging.sigmacomputing.io",
22-
);
21+
iframe.contentWindow.postMessage(message, SIGMA_COMPUTING_URL);
22+
};
23+
24+
/**
25+
* DO NOT USE IN PRODUCTION.
26+
*
27+
* This will override the Sigma Computing URL used for mutations.
28+
*
29+
* @param url the URL to use instead of the default
30+
*/
31+
export const DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl = (url: string) => {
32+
SIGMA_COMPUTING_URL = url;
2333
};
2434

2535
export const workbookBookmarkCreate = (

packages/react-embed-sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"dist"
3636
],
3737
"peerDependencies": {
38-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
39-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
38+
"react": "^16.8.0 || ^17.0 || ^18.0 || ^19.0 || 19.0.0-rc",
39+
"react-dom": "^16.8.0 || ^17.0 || ^18.0 || ^19.0 || 19.0.0-rc"
4040
},
4141
"devDependencies": {
4242
"@sigmacomputing/eslint-config": "workspace:*",

packages/react-embed-sdk/src/mutations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
workbookSharingLinkUpdate,
1010
} from "@sigmacomputing/embed-sdk";
1111

12+
export { DO_NOT_USE_IN_PRODUCTION_overrideMutationUrl } from "@sigmacomputing/embed-sdk";
13+
1214
export function getWorkbookVariables(
1315
iframeRef: React.RefObject<HTMLIFrameElement>,
1416
) {

0 commit comments

Comments
 (0)