appwrite/sdk-for-web sits at 336 stars on GitHub, written primarily in TypeScript. [READ-ONLY] Official Appwrite Web SDK ๐งก
Snapshot summary built from the project's own GitHub metadata โ there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then โ see the READ ME tab for the original README in full.
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 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
Installation
npm
npm install appwrite
Import the modules you need. The package ships ES modules, CommonJS and TypeScript types:
import { Client, Account } from 'appwrite';
CDN
Every release is published to https://sdk.appwrite.io/web/29.3.0-rc.1/.
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:
<script type="module">
import { Client } from 'https://sdk.appwrite.io/web/29.3.0-rc.1/client.js';
import { Account } from 'https://sdk.appwrite.io/web/29.3.0-rc.1/account.js';
import { OAuthProvider } from 'https://sdk.appwrite.io/web/29.3.0-rc.1/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:
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:
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.
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 for every service and method.
import { Account, ID } from 'appwrite';
const account = new Account(client);
const user = await account.create({
userId: ID.unique(),
email: '[email protected]',
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.
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:
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:
The Appwrite CLI can generate these interfaces from your database schema with appwrite types. See type generation.
Error handling
Failed requests throw an AppwriteException with message, code, type and response properties.
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 page lists every error type.
Learn more
Web quick start
Appwrite docs
Discord community
Web playground
Contribution
This library is auto-generated by the Appwrite SDK Generator. To learn more about how you can help us improve this SDK, please check the contribution guide before sending a pull-request.
License
Please see the BSD-3-Clause license file for more information.
How active is development on appwrite/sdk-for-web?
The most recent commit recorded on appwrite/sdk-for-web was 6 days ago, based on the GitHub push timestamp. The repository has 62 forks โ one of the better signals of community interest.
How does appwrite/sdk-for-web compare to other Frontend projects?
appwrite/sdk-for-web is tracked by TopGit in the Frontend category, with 336 GitHub stars and written in TypeScript. Browse the Frontend topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does appwrite/sdk-for-web have?
appwrite/sdk-for-web has 336 GitHub stars โ refresh the page for the live number, or check github.com/appwrite/sdk-for-web. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What is appwrite/sdk-for-web?
appwrite/sdk-for-web (appwrite/sdk-for-web) is a TypeScript project on GitHub. From the project's own README: [READ-ONLY] Official Appwrite Web SDK ๐งก
What language is appwrite/sdk-for-web written in?
appwrite/sdk-for-web is written primarily in TypeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is appwrite/sdk-for-web associated with?
Why is appwrite/sdk-for-web categorized under Frontend?
TopGit places appwrite/sdk-for-web in the Frontend category based on its GitHub topics and description (tagged: "angular", "appwrite", "baas"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Is sdk-for-web worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of sdk-for-web.