@mastra/react 1.4.10-alpha.7 → 1.4.10-alpha.9
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/README.md +37 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @mastra/react
|
|
2
|
+
|
|
3
|
+
`@mastra/react` provides React context, hooks, message utilities, voice helpers, and UI primitives for applications that connect to a Mastra server. Wrap the application once with `MastraReactProvider`, then access the configured client throughout the component tree.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mastra/react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { MastraReactProvider } from '@mastra/react';
|
|
15
|
+
|
|
16
|
+
export function App({ children }: { children: React.ReactNode }) {
|
|
17
|
+
return <MastraReactProvider baseUrl="http://localhost:4111">{children}</MastraReactProvider>;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
`MastraReactProvider` constructs and shares the Mastra client. In addition to `baseUrl`, it accepts custom headers, an API prefix, fetch credentials, and a custom `fetch` implementation for applications that need authentication or request instrumentation. Use `useMastraClient()` when a component needs direct access to the underlying client.
|
|
24
|
+
|
|
25
|
+
The package exports agent hooks such as `useChat` for generated or streamed conversations, including optimistic messages, tool calls, approvals, task signals, aborts, and reconnection to active runs. It also exports workflow hooks and `WorkflowStepFactory` for consuming workflow state and streamed step results.
|
|
26
|
+
|
|
27
|
+
Voice helpers include browser speech recognition, microphone recording, and Web Audio playback. Message utilities expose Mastra's database message types and accumulation helpers, while the `@mastra/react/ui` entry point provides reusable message, code, icon, button, entity, and tooltip components. Import `@mastra/react/styles.css` when using the packaged UI components.
|
|
28
|
+
|
|
29
|
+
React 19 or newer is required. The package also expects compatible versions of `@mastra/core` and Zod in the consuming application.
|
|
30
|
+
|
|
31
|
+
## Changelog
|
|
32
|
+
|
|
33
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/client-sdks/react/CHANGELOG.md) for version history and release notes.
|
|
34
|
+
|
|
35
|
+
## Support
|
|
36
|
+
|
|
37
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/react",
|
|
3
|
-
"version": "1.4.10-alpha.
|
|
3
|
+
"version": "1.4.10-alpha.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"lucide-react": "^1.37.0",
|
|
49
49
|
"shiki": "^1.29.2",
|
|
50
50
|
"tailwind-merge": "^3.5.0",
|
|
51
|
-
"@mastra/client-js": "1.
|
|
51
|
+
"@mastra/client-js": "1.43.0-alpha.8"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@mastra/core": ">=1.8.0-0 <2.0.0-0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"zod": "^3.25.76",
|
|
81
81
|
"@internal/lint": "0.0.129",
|
|
82
82
|
"@internal/types-builder": "0.0.104",
|
|
83
|
-
"@mastra/core": "1.64.0-alpha.
|
|
83
|
+
"@mastra/core": "1.64.0-alpha.8"
|
|
84
84
|
},
|
|
85
85
|
"eslintConfig": {
|
|
86
86
|
"extends": [
|