# @nhost/react

> Nhost React library

Latest version **3.11.2** (published 2025-08-29) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @nhost/react
pnpm add @nhost/react
yarn add @nhost/react
bun add @nhost/react
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.11.2 |
| Published | 2025-08-29 |
| First published | 2022-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9376 |
| Author | Nhost |
| Maintainers | nunopato, david.barroso |
| Keywords | nhost, hasura, storage, auth, authentication, graphql, postgresql, realtime, react |

## Links

- npm: https://www.npmjs.com/package/@nhost/react
- Repository: https://github.com/nhost/nhost
- Homepage: https://nhost.io
- Issues: https://github.com/nhost/nhost/issues
- npm.io page: https://npm.io/package/@nhost/react

## Dependencies (5)

- [xstate](https://npm.io/package/xstate.md) ^4.38.3
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^4.0.0
- [@xstate/react](https://npm.io/package/@xstate/react.md) ^3.2.2
- [@nhost/nhost-js](https://npm.io/package/@nhost/nhost-js.md) 3.3.1

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 3.11.2 (latest) — 2025-08-29
- 3.11.1 — 2025-07-01
- 3.11.0 — 2025-06-05
- 3.10.4 — 2025-04-28
- 3.10.3 — 2025-04-08
- 3.10.2 — 2025-03-12
- 3.10.1 — 2025-02-25
- 3.10.0 — 2025-02-05
- 3.9.1 — 2025-01-27
- 3.9.0 — 2025-01-10
- 3.8.1 — 2025-01-08
- 3.8.0 — 2024-11-28
- 3.7.0 — 2024-11-26
- 3.6.0 — 2024-09-25
- 3.5.6 — 2024-09-09
- … 123 more at https://npm.io/package/@nhost/react/versions

## README

# Nhost React

The Nhost React client exports a React provider, hooks, and helpers that make it easier to work with Nhost in your React app. If you're using React with Next.js, you should use the [Nhost Next.js client](/reference/nextjs).

## Documentation

- [Quickstart](https://docs.nhost.io/platform/quickstarts/react)
- [Reference documentation](https://docs.nhost.io/reference/react)

## Install

Install the Nhost React client together with GraphQL:

```bash
# With npm
npm install @nhost/react graphql

# With Yarm
yarn add @nhost/react graphql
```

## Initialise

Initialize a single `nhost` instance and wrap your app with the `NhostReactProvider`.

```jsx title=src/App.tsx
import React from 'react'
import ReactDOM from 'react-dom'

import { NhostClient, NhostProvider } from '@nhost/react'

import App from './App'

const nhost = new NhostClient({
  subdomain: '<Your Nhost app subdomain>',
  region: '<Your Nhost app region>'
})

ReactDOM.render(
  <React.StrictMode>
    <NhostProvider nhost={nhost}>
      <App />
    </NhostProvider>
  </React.StrictMode>,
  document.getElementById('root')
)
```

---
_Source: https://npm.io/package/@nhost/react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
