# @nhost/nhost-js

> Nhost JavaScript SDK

Latest version **4.9.0** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nhost/nhost-js
pnpm add @nhost/nhost-js
yarn add @nhost/nhost-js
bun add @nhost/nhost-js
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.9.0 |
| Published | 2026-09-30 |
| First published | 2021-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 1 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9378 |
| Author | Nhost |
| Maintainers | nunopato, david.barroso |
| Keywords | nhost, sdk, api, javascript, typescript |

## Links

- npm: https://www.npmjs.com/package/@nhost/nhost-js
- 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/nhost-js

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.9.0 (latest) — 2026-09-30
- 4.3.0-rc1 (beta) — 2026-01-13
- 0.0.1-8 (next) — 2021-08-17
- 4.8.0 — 2026-07-31
- 4.7.3 — 2026-06-29
- 4.7.2 — 2026-06-03
- 4.7.1 — 2026-05-18
- 4.7.0 — 2026-04-20
- 4.6.0 — 2026-03-28
- 4.5.0 — 2026-02-19
- 4.4.0 — 2026-02-06
- 4.3.0 — 2026-02-02
- 4.2.2 — 2026-01-13
- 4.2.1 — 2025-12-19
- 4.2.1-rc2 — 2025-12-18
- … 197 more at https://npm.io/package/@nhost/nhost-js/versions

## README

# Nhost JavaScript SDK

The Nhost JavaScript SDK provides a client-side interface to interact with Nhost services, including authentication, storage, and GraphQL operations.

## Installation

```bash
# npm
npm install @nhost/nhost-js

# yarn
yarn add @nhost/nhost-js

# pnpm
pnpm add @nhost/nhost-js
```

## Quick Start

```typescript
import { createClient } from '@nhost/nhost-js'

// Initialize the Nhost client
const nhost = createClient({
  subdomain: 'your-project',
  region: 'eu-central-1'
})

// Use authentication features
const signinResponse = await nhost.auth.signInEmailPassword({
  email: 'user@example.com',
  password: 'password123'
})

if (signinResponse.body.session) {
  console.log('Signed in successfully!')
}

// Use GraphQL features
const graphqlResponse = await nhost.graphql.request({
  query: `
    query GetUsers {
      users {
        id
        displayName
        email
      }
    }
  `
})


// Use storage features
const storageResponse = await nhost.storage.uploadFiles({
  'file[]': [file]
})

return storageResponse.body.processedFiles[0]

// call a serverless function
const functionsResponse = await nhost.functions.fetch('/echo', {
  method: 'POST',
  body: JSON.stringify({
    message: 'Hello, world!'
  }),
  headers: {
    'Content-Type': 'application/json'
  }
})
```

## Modules

The Nhost SDK consists of several modules:

- **Auth**: User authentication and session management
- **Storage**: File upload, download, and management
- **GraphQL**: Executing queries and mutations against your Hasura GraphQL API
- **Functions**: Invoking serverless functions

## Documentation

For detailed documentation and API reference, see the [Nhost Documentation](https://docs.nhost.io).

## License

MIT

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