@schematichq/schematic-react 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -235,7 +235,7 @@ var Schematic = class {
|
|
235
235
|
}
|
236
236
|
};
|
237
237
|
sendEvent = (event) => {
|
238
|
-
const captureUrl = this.getUrl(this.
|
238
|
+
const captureUrl = this.getUrl(this.eventUrl, "e");
|
239
239
|
const payload = JSON.stringify(event);
|
240
240
|
fetch(captureUrl, {
|
241
241
|
method: "POST",
|
@@ -343,8 +343,9 @@ var SchematicContext = (0, import_react.createContext)({
|
|
343
343
|
flagValues: {}
|
344
344
|
});
|
345
345
|
var SchematicProvider = ({
|
346
|
-
|
347
|
-
children
|
346
|
+
apiUrl,
|
347
|
+
children,
|
348
|
+
publishableKey
|
348
349
|
}) => {
|
349
350
|
const [client, setClient] = (0, import_react.useState)();
|
350
351
|
const [flagValues, setFlagValues] = (0, import_react.useState)({});
|
@@ -353,6 +354,7 @@ var SchematicProvider = ({
|
|
353
354
|
return;
|
354
355
|
}
|
355
356
|
const client2 = new Schematic(publishableKey, {
|
357
|
+
apiUrl,
|
356
358
|
flagListener: setFlagValues,
|
357
359
|
useWebSocket: true
|
358
360
|
});
|
@@ -205,7 +205,7 @@ var Schematic = class {
|
|
205
205
|
}
|
206
206
|
};
|
207
207
|
sendEvent = (event) => {
|
208
|
-
const captureUrl = this.getUrl(this.
|
208
|
+
const captureUrl = this.getUrl(this.eventUrl, "e");
|
209
209
|
const payload = JSON.stringify(event);
|
210
210
|
fetch(captureUrl, {
|
211
211
|
method: "POST",
|
@@ -318,8 +318,9 @@ var SchematicContext = createContext({
|
|
318
318
|
flagValues: {}
|
319
319
|
});
|
320
320
|
var SchematicProvider = ({
|
321
|
-
|
322
|
-
children
|
321
|
+
apiUrl,
|
322
|
+
children,
|
323
|
+
publishableKey
|
323
324
|
}) => {
|
324
325
|
const [client, setClient] = useState();
|
325
326
|
const [flagValues, setFlagValues] = useState({});
|
@@ -328,6 +329,7 @@ var SchematicProvider = ({
|
|
328
329
|
return;
|
329
330
|
}
|
330
331
|
const client2 = new Schematic(publishableKey, {
|
332
|
+
apiUrl,
|
331
333
|
flagListener: setFlagValues,
|
332
334
|
useWebSocket: true
|
333
335
|
});
|
package/package.json
CHANGED
@@ -42,9 +42,9 @@
|
|
42
42
|
"test": "jest --config jest.config.js"
|
43
43
|
},
|
44
44
|
"types": "dist/schematic-react.d.ts",
|
45
|
-
"version": "0.1.
|
45
|
+
"version": "0.1.4",
|
46
46
|
"dependencies": {
|
47
|
-
"@schematichq/schematic-js": "^0.1.
|
47
|
+
"@schematichq/schematic-js": "^0.1.4"
|
48
48
|
},
|
49
49
|
"peerDependencies": {
|
50
50
|
"react": ">=18"
|