A powerful TypeScript ORM for Appwrite with automatic migrations, schema validation, and join support. Works seamlessly in both server and client environments.
npm install appwrite-orm node-appwriteimport { ServerORM } from 'appwrite-orm/server';
const orm = new ServerORM({
endpoint: process.env.APPWRITE_ENDPOINT!,
projectId: process.env.APPWRITE_PROJECT_ID!,
databaseId: process.env.APPWRITE_DATABASE_ID!,
apiKey: process.env.APPWRITE_API_KEY!,
autoMigrate: true
});
const db = await orm.init([{
name: 'users',
schema: {
name: { type: 'string', required: true },
email: { type: 'string', required: true },
age: { type: 'integer', min: 0 }
},
indexes: [
{ key: 'email_idx', type: 'unique',
attributes: ['email'] }
]
}]);
const user = await db.table('users').create({
name: 'John Doe',
email: 'john@example.com',
age: 30
});Powerful features for modern application development
Full TypeScript support with automatic type inference for your Appwrite collections
Automatic schema synchronization and index creation without manual intervention
Built in caching system for web and servers
A custom MCP server, so your AI model doesn't make stuff up about Appwrite-ORM
Use the ORM in web clients with cookie-based storage for easy local development
Built in functions to export your database to SQL, firebase rules, etc
Latest additions in the current version (0.3.1)
Migrations from Appwrite to SQL, Firebase and text. So you're never stuck on 1 of these
A simple, built-in caching system using appwrite listeners
Exciting features coming soon
Get started with Appwrite ORM today and experience the power of type-safe database operations.