# appwrite

> Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API

Latest version **29.4.0** (published 2026-11-25) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install appwrite
pnpm add appwrite
yarn add appwrite
bun add appwrite
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 29.4.0 |
| Published | 2026-11-25 |
| First published | 2019-06-03 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.0.0 |
| Dependencies | 3 |
| Unpacked size | 8.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 336 |
| Maintainers | eldadfux, torstendittmann, stnguyen90 |

## Links

- npm: https://www.npmjs.com/package/appwrite
- Repository: https://github.com/appwrite/sdk-for-web
- Homepage: https://appwrite.io/support
- Issues: https://github.com/appwrite/sdk-for-web/issues
- npm.io page: https://npm.io/package/appwrite

## Dependencies (3)

- [mqtt](https://npm.io/package/mqtt.md) 5.16.1
- [buffer](https://npm.io/package/buffer.md) 6.0.3
- [json-bigint](https://npm.io/package/json-bigint.md) 1.0.0

## Recent versions

- 29.4.0 (latest) — 2026-11-25
- 29.3.0-rc.1 (next) — 2026-11-05
- 29.3.1 — 2026-11-17
- 29.3.0 — 2026-11-16
- 29.2.0 — 2026-10-28
- 29.1.0 — 2026-10-19
- 29.0.0 — 2026-10-15
- 28.3.0 — 2026-10-13
- 28.2.0 — 2026-10-12
- 28.2.0-rc.7 — 2026-10-08
- 28.2.0-rc.6 — 2026-10-07
- 28.2.0-rc.4 — 2026-10-07
- 28.2.0-rc.3 — 2026-10-06
- 28.2.0-rc.2 — 2026-10-06
- 28.2.0-rc.1 — 2026-10-06
- … 114 more at https://npm.io/package/appwrite/versions

## README

# Appwrite Web SDK

![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.7.2-blue.svg?style=flat-square)
[![X Account](https://img.shields.io/badge/follow-%40appwrite-000000?logo=x&style=flat-square)](https://x.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK targets Appwrite server version 2.7.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-web/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)

## Installation

### npm

```bash
npm install appwrite
```

Import the modules you need. The package ships ES modules, CommonJS and TypeScript types:

```js
import { Client, Account } from 'appwrite';
```

### CDN

Every release is published to `https://sdk.appwrite.io/web/29.4.0/`.

#### ES modules

Each service, helper and enum is its own module, so the browser downloads only what you import. A service is served under its name in kebab case, such as `TablesDB` from `tables-db.js`, and enums under `enums/`, such as `OAuthProvider` from `enums/o-auth-provider.js`. `index.js` re-exports everything, so importing it loads every service:

```html
<script type="module">
    import { Client } from 'https://sdk.appwrite.io/web/29.4.0/client.js';
    import { Account } from 'https://sdk.appwrite.io/web/29.4.0/account.js';
    import { OAuthProvider } from 'https://sdk.appwrite.io/web/29.4.0/enums/o-auth-provider.js';
</script>
```

#### Script tag

Add the script before any code that uses the SDK. It exposes every export on the global `Appwrite` object:

```html
<script src="https://sdk.appwrite.io/web/29.4.0/sdk.min.js"></script>
<script>
    const { Client, Account } = Appwrite;
</script>
```

#### Subresource integrity

`integrity.json` in the same directory maps each `.js` file to its `sha384-` hash. An `integrity` attribute checks only the file it is set on. `sdk.min.js` is a single file, so its hash as the `integrity` attribute, together with `crossorigin="anonymous"`, covers the whole SDK. ES modules import other modules and shared chunks, so supply their hashes through the `integrity` field of an import map to cover those too.

#### jsDelivr

The script tag build is also available from jsDelivr:

```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@29.4.0"></script>
```

## Getting started

### Add a Web platform

In the Appwrite Console, open your project and under **Add a platform** choose **Web app**. Enter the hostname your app runs on: `localhost` for local development, and your production domain once you deploy. Appwrite only accepts browser requests from hostnames registered as platforms, so a missing hostname shows up as a CORS error.

### Initialize the client

Copy your endpoint and project ID from your project's **Settings** page.

```js
import { Client } from 'appwrite';

const client = new Client()
    .setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
    .setProject('<PROJECT_ID>');
```

For a self-hosted Appwrite, use `https://<HOSTNAME>/v1` as the endpoint.

### Make your first request

Create a service from the client and call any of its methods. Every method takes a single object of named parameters and returns a promise. See the [API reference](https://appwrite.io/docs/references) for every service and method.

```js
import { Account, ID } from 'appwrite';

const account = new Account(client);

const user = await account.create({
    userId: ID.unique(),
    email: 'email@example.com',
    password: 'password',
    name: "Walter O'Brien",
});

console.log(user);
```

### Sign in with OAuth

Enable the provider in the Console under **Auth > Settings**, then redirect the user to it. The `success` and `failure` URLs must be on a hostname you registered as a platform.

```js
import { Account, OAuthProvider } from 'appwrite';

const account = new Account(client);

account.createOAuth2Session({
    provider: OAuthProvider.Github,
    success: 'https://example.com/success',
    failure: 'https://example.com/failure',
});
```

### Type safety with models

Methods that return rows, such as `listRows` and `getRow`, accept a type parameter for your own row shape:

```ts
import { TablesDB, type Models } from 'appwrite';

interface Book extends Models.Row {
    name: string;
    author: string;
    releaseYear?: string;
    genre?: string[];
    isCheckedOut: boolean;
}

const tablesDB = new TablesDB(client);

const result = await tablesDB.listRows<Book>({
    databaseId: '<DATABASE_ID>',
    tableId: '<TABLE_ID>',
});

for (const book of result.rows) {
    console.log(`${book.name} by ${book.author}`);
}
```

In JavaScript, the same types are available through JSDoc:

```js
import { TablesDB } from 'appwrite';

const tablesDB = new TablesDB(client);

/**
 * @typedef {import('appwrite').Models.Row & {
 *     name: string,
 *     author: string,
 *     isCheckedOut: boolean,
 * }} Book
 */

/** @type {import('appwrite').Models.RowList<Book>} */
const result = await tablesDB.listRows({
    databaseId: '<DATABASE_ID>',
    tableId: '<TABLE_ID>',
});
```

The [Appwrite CLI](https://github.com/appwrite/sdk-for-cli) can generate these interfaces from your database schema with `appwrite types`. See [type generation](https://appwrite.io/docs/products/databases/tablesdb/type-generation).

### Error handling

Failed requests throw an `AppwriteException` with `message`, `code`, `type` and `response` properties.

```js
import { AppwriteException } from 'appwrite';

try {
    const user = await account.get();
    console.log(user);
} catch (error) {
    if (error instanceof AppwriteException) {
        console.error(error.code, error.type, error.message);
    }
}
```

The [response codes](https://appwrite.io/docs/apis/response-codes) page lists every error type.

### Learn more

- [Web quick start](https://appwrite.io/docs/quick-starts/web)
- [Appwrite docs](https://appwrite.io/docs)
- [Discord community](https://appwrite.io/discord)
- [Web playground](https://github.com/appwrite/playground-for-web)

## Contribution

This library is auto-generated by the Appwrite [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/main/CONTRIBUTING.md) before sending a pull-request.

## License

Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

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