@mastra/react 0.2.22 → 0.2.23-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/react
2
2
 
3
+ ## 0.2.23-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`f32b9e1`](https://github.com/mastra-ai/mastra/commit/f32b9e115a3c754d1c8cfa3f4256fba87b09cfb7)]:
8
+ - @mastra/core@1.23.0-alpha.1
9
+ - @mastra/client-js@1.13.1-alpha.1
10
+
11
+ ## 0.2.23-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`ed425d7`](https://github.com/mastra-ai/mastra/commit/ed425d78e7c66cbda8209fee910856f98c6c6b82), [`ba6f7e9`](https://github.com/mastra-ai/mastra/commit/ba6f7e9086d8281393f2acae60fda61de3bff1f9), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a)]:
16
+ - @mastra/core@1.23.0-alpha.0
17
+ - @mastra/client-js@1.13.1-alpha.0
18
+
3
19
  ## 0.2.22
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -17,9 +17,10 @@ var MastraClientProvider = ({
17
17
  baseUrl,
18
18
  headers,
19
19
  apiPrefix,
20
- credentials = "include"
20
+ credentials = "include",
21
+ customFetch
21
22
  }) => {
22
- const client = createMastraClient(baseUrl, headers, apiPrefix, credentials);
23
+ const client = createMastraClient(baseUrl, headers, apiPrefix, credentials, customFetch);
23
24
  return /* @__PURE__ */ jsxRuntime.jsx(MastraClientContext.Provider, { value: client, children });
24
25
  };
25
26
  var useMastraClient = () => react.useContext(MastraClientContext);
@@ -38,12 +39,13 @@ var isLocalUrl = (url) => {
38
39
  return false;
39
40
  }
40
41
  };
41
- var createMastraClient = (baseUrl, mastraClientHeaders = {}, apiPrefix, credentials = "include") => {
42
+ var createMastraClient = (baseUrl, mastraClientHeaders = {}, apiPrefix, credentials = "include", customFetch) => {
42
43
  return new clientJs.MastraClient({
43
44
  baseUrl: baseUrl || "",
44
45
  headers: isLocalUrl(baseUrl) ? { ...mastraClientHeaders, "x-mastra-dev-playground": "true" } : mastraClientHeaders,
45
46
  apiPrefix,
46
- credentials
47
+ credentials,
48
+ fetch: customFetch
47
49
  });
48
50
  };
49
51
  var MastraReactProvider = ({
@@ -51,9 +53,20 @@ var MastraReactProvider = ({
51
53
  baseUrl,
52
54
  headers,
53
55
  apiPrefix,
54
- credentials
56
+ credentials,
57
+ customFetch
55
58
  }) => {
56
- return /* @__PURE__ */ jsxRuntime.jsx(MastraClientProvider, { baseUrl, headers, apiPrefix, credentials, children });
59
+ return /* @__PURE__ */ jsxRuntime.jsx(
60
+ MastraClientProvider,
61
+ {
62
+ baseUrl,
63
+ headers,
64
+ apiPrefix,
65
+ credentials,
66
+ customFetch,
67
+ children
68
+ }
69
+ );
57
70
  };
58
71
 
59
72
  // src/lib/ai-sdk/utils/formatCompletionFeedback.ts