@streamlayer/react 0.34.13 → 0.35.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.
@@ -39957,7 +39957,7 @@ const D$ = (n, a) => {
39957
39957
  }
39958
39958
  });
39959
39959
  }, R$ = (n, a, s) => {
39960
- n.transport = new I$(a.host), n.sdk.host = n.transport.host, n.transport.setSdkKey(a.sdkKey), s();
39960
+ n.transport = new I$(a.host), n.sdk.host = n.transport.host, n.transport.setSdkKey(a.sdkKey), n.transport.setHeader("sl-sdk-version", a.version || "-"), s();
39961
39961
  };
39962
39962
  class _k {
39963
39963
  constructor(a = "main") {
@@ -43314,15 +43314,15 @@ zk.exports.express = function(n) {
43314
43314
  };
43315
43315
  var DW = zk.exports;
43316
43316
  const AW = /* @__PURE__ */ l$(DW);
43317
- function OW(n, a = !0, s = !0) {
43318
- const f = a ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", u = AW(/* @__PURE__ */ Object.create({}), { autostart: !1 });
43319
- return u.use(V$), u.use(R$, { sdkKey: n, host: f }), u.use(Q$), u.use(F$), u.use(bG), u.use(sG), s && u.after(async (y, h, T) => {
43320
- if (y)
43321
- throw y;
43322
- await h.sdk.initializeApp(), T();
43323
- }), u.onClose(() => {
43317
+ function OW(n, a = !0, s = !0, f) {
43318
+ const u = a ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", y = AW(/* @__PURE__ */ Object.create({}), { autostart: !1 });
43319
+ return y.use(V$), y.use(R$, { sdkKey: n, host: u, version: f == null ? void 0 : f.version }), y.use(Q$), y.use(F$), y.use(bG), y.use(sG), s && y.after(async (h, T, w) => {
43320
+ if (h)
43321
+ throw h;
43322
+ await T.sdk.initializeApp(), w();
43323
+ }), y.onClose(() => {
43324
43324
  console.log("close");
43325
- }), u;
43325
+ }), y;
43326
43326
  }
43327
43327
  const CW = (n, a, s, f) => {
43328
43328
  const [u, y] = ra(null);
@@ -43332,7 +43332,9 @@ const CW = (n, a, s, f) => {
43332
43332
  return console.error("streamlayer sdk key should be provided"), y((w) => (w !== null && typeof w.disableApp == "function" && w.disableApp(), null)), () => {
43333
43333
  h = !0;
43334
43334
  };
43335
- const T = OW(n, s, f);
43335
+ const T = OW(n, s, f, {
43336
+ version: "0.35.0"
43337
+ });
43336
43338
  if (a)
43337
43339
  for (const w of a)
43338
43340
  T.use(w);
@@ -424,6 +424,7 @@ declare module "../../sdk-web-api/src/index" {
424
424
  export const transport: (instance: StreamLayerContext, opts: {
425
425
  sdkKey: string;
426
426
  host: string;
427
+ version?: string;
427
428
  }, done: () => void) => void;
428
429
  }
429
430
  declare module "../../sdk-web-storage/src/index" {
@@ -1501,7 +1502,9 @@ declare module "../../sdk-web/src/index" {
1501
1502
  export type StreamLayerInstance = avvio.mixedInstance<StreamLayerContext>;
1502
1503
  export type StreamLayerPlugin = (instance: StreamLayerContext, opts: unknown, done: DoneFn) => void;
1503
1504
  type DoneFn = Function;
1504
- export function StreamLayer(sdkKey: string, production?: boolean, autoEnable?: boolean): avvio.Avvio<StreamLayerContext>;
1505
+ export function StreamLayer(sdkKey: string, production?: boolean, autoEnable?: boolean, meta?: {
1506
+ version?: string;
1507
+ }): avvio.Avvio<StreamLayerContext>;
1505
1508
  }
1506
1509
  declare module "app/useStreamLayerApp" {
1507
1510
  import type { StreamLayerSDK, StreamLayerPlugin } from '../../sdk-web-interfaces/src/index.ts';
@@ -1,14 +1,16 @@
1
- import { StreamLayer as a } from "@streamlayer/sdk-web";
2
- import { useState as i, useEffect as c } from "react";
1
+ import { StreamLayer as i } from "@streamlayer/sdk-web";
2
+ import { useState as a, useEffect as c } from "react";
3
3
  const m = (t, n, s, f) => {
4
- const [u, l] = i(null);
4
+ const [u, l] = a(null);
5
5
  return c(() => {
6
6
  let r = !1;
7
7
  if (!t)
8
8
  return console.error("streamlayer sdk key should be provided"), l((e) => (e !== null && typeof e.disableApp == "function" && e.disableApp(), null)), () => {
9
9
  r = !0;
10
10
  };
11
- const o = a(t, s, f);
11
+ const o = i(t, s, f, {
12
+ version: "0.35.0"
13
+ });
12
14
  if (n)
13
15
  for (const e of n)
14
16
  o.use(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react",
3
- "version": "0.34.13",
3
+ "version": "0.35.0",
4
4
  "type": "module",
5
5
  "author": "StreamLayer, Inc (https://streamlayer.io)",
6
6
  "maintainers": [
@@ -54,11 +54,11 @@
54
54
  }
55
55
  ],
56
56
  "dependencies": {
57
- "@streamlayer/feature-gamification": "^0.33.4",
58
- "@streamlayer/sdk-web": "^0.29.5",
59
- "@streamlayer/sdk-web-api": "^0.0.1",
57
+ "@streamlayer/feature-gamification": "^0.33.5",
58
+ "@streamlayer/sdk-web": "^0.1.0",
59
+ "@streamlayer/sdk-web-api": "^0.1.0",
60
60
  "@streamlayer/sdk-web-core": "^0.0.1",
61
- "@streamlayer/sdk-web-features": "^0.11.10",
61
+ "@streamlayer/sdk-web-features": "^0.11.11",
62
62
  "@streamlayer/sdk-web-interfaces": "^0.18.21",
63
63
  "@streamlayer/sdk-web-logger": "^0.0.1",
64
64
  "@streamlayer/sdk-web-notifications": "^0.0.6",
@@ -119,7 +119,7 @@
119
119
  "size-limit": "^11.0.0",
120
120
  "url-loader": "^4.1.1",
121
121
  "vite-plugin-dts": "^3.6.3",
122
- "@streamlayer/react-ui": "^0.89.6"
122
+ "@streamlayer/react-ui": "^0.89.7"
123
123
  },
124
124
  "scripts": {
125
125
  "size-limit": "size-limit"