0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/client-sdks/react
dane-ai-mastra[bot] 3c7d26e6ab
chore: version packages (alpha) (#30516)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases

> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.

## @mastra/factory@0.29.0-alpha.5


## mastra@1.40.0-alpha.4


## @mastra/core@1.84.0-alpha.4


## @mastra/playground-ui@69.1.0-alpha.4


## @mastra/libsql@1.31.0-alpha.2


## @mastra/pg@1.37.0-alpha.2


## @mastra/client-js@1.60.1-alpha.4


## @mastra/react@1.15.1-alpha.4


## @mastra/deployer-cloud@1.84.0-alpha.4


## @mastra/longmemeval@1.1.43-alpha.4


## @mastra/opencode@0.1.43-alpha.4


## create-factory@0.4.4-alpha.4


## @mastra/code-sdk@1.19.1-alpha.5


## mastracode@0.50.1-alpha.5


## @mastra/deployer@1.84.0-alpha.4


## @mastra/mcp-apps-components@0.1.1-alpha.1


## @mastra/mcp-docs-server@1.3.14-alpha.4


## @mastra/server@1.84.0-alpha.4


## @mastra/redis-streams@0.9.0-alpha.2


## @mastra/elysia@0.1.24-alpha.4


## @mastra/express@1.5.28-alpha.4


## @mastra/fastify@1.5.28-alpha.4


## @mastra/hono@1.7.26-alpha.4


## @mastra/koa@1.7.28-alpha.4


## @mastra/nestjs@0.3.1-alpha.4


## @mastra/next@0.2.42-alpha.4


## @mastra/tanstack-start@0.2.42-alpha.4


## @mastra/convex@1.9.1-alpha.2


## @mastra/turso@0.1.22-alpha.2


## @mastra/inngest@1.11.3-alpha.0


## @mastra/temporal@0.6.1-alpha.4


## @mastra/platform-workspace@1.13.1-alpha.0


## create-mastra@1.40.0-alpha.4


## @internal/playground@1.40.0-alpha.4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
History 2026-11-16 23:44:41 +01:00
..
.storybook chore: migrate linting to oxlint (#20173) 2026-07-25 01:04:02 +02:00
src feat(react): show new feedback comments immediately (#30515) 2026-11-16 17:14:24 +01:00
CHANGELOG.md chore: version packages (alpha) (#30516) 2026-11-16 23:44:41 +01:00
lint-staged.config.js refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
oxlint.config.ts refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
package.json chore: version packages (alpha) (#30516) 2026-11-16 23:44:41 +01:00
README.md chore(*): Update/unify/add READMEs (#22858) 2026-09-02 14:36:59 +02:00
tsconfig.build.json Move Studio data hooks to a public @mastra/react/hooks entry (#25916) 2026-10-05 09:10:00 +02:00
tsconfig.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
tsdown.config.ts feat(react): split @mastra/react/hooks into per-domain entries (#25950) 2026-10-05 16:30:29 +02:00
turbo.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vite.config.ts fix(react,playground): externalize @mastra/core and stub Node builtins (#13703) 2026-03-03 11:25:27 -08:00
vitest.config.ts Move Studio data hooks to a public @mastra/react/hooks entry (#25916) 2026-10-05 09:10:00 +02:00

@mastra/react

@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.

Installation

npm install @mastra/react

Usage

import { MastraReactProvider } from '@mastra/react';

export function App({ children }: { children: React.ReactNode }) {
  return <MastraReactProvider baseUrl="http://localhost:4111">{children}</MastraReactProvider>;
}

Documentation

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.

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.

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.

React 19 or newer is required. The package also expects compatible versions of @mastra/core and Zod in the consuming application.

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.