
Appwrite Typescript
Wire Appwrite auth, tables, storage, realtime, and admin APIs into web, React Native, or Node/Deno apps without guessing SDK patterns.
Overview
Appwrite TypeScript is an agent skill for the Build phase that maps Appwrite client and server SDK patterns for auth, data, storage, and realtime in TypeScript projects.
Install
npx skills add https://github.com/appwrite/agent-skills --skill appwrite-typescriptWhat is this skill?
- Client vs server setup for web, React Native, and node-appwrite with API keys
- Email, OAuth, and anonymous auth flows on the client Account API
- TablesDB queries with ID and Query helpers plus Storage uploads
- Real-time subscriptions from browser or mobile clients
- Server-side Users, Functions, and admin operations with scoped keys
- 3 runtime install paths (web, React Native, Node/Deno)
Adoption & trust: 970 installs on skills.sh; 20 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You chose Appwrite as your backend but need correct client versus admin SDK setup and copy-paste-safe patterns for auth, queries, and uploads.
Who is it for?
Solo builders shipping a web or mobile app on Appwrite who want SDK-accurate TypeScript instead of generic REST guesses.
Skip if: Teams not using Appwrite, or projects that only need a one-off curl without ongoing SDK maintenance.
When should I use this skill?
Building browser JavaScript/TypeScript apps, React Native mobile apps, or Node.js/Deno backends with Appwrite for auth, database, storage, realtime, or admin APIs.
What do I get? / Deliverables
Your agent generates TypeScript that matches Appwrite’s endpoint, project, and key model for the target runtime with working auth, data, and storage calls.
- Client or server Appwrite Client configuration
- Auth, query, storage, or subscription code blocks
- Environment variable layout for project ID and API key
Recommended Skills
Journey fit
Backend BaaS integration is canonical in Build once you are implementing product features against a hosted backend. The skill is a third-party SDK integration guide, not generic frontend layout or pure DevOps.
How it compares
Use as a procedural Appwrite SDK guide rather than generic OpenAPI or REST integration skills.
Common Questions / FAQ
Who is appwrite-typescript for?
Indie and solo developers building browser, React Native, or Node/Deno apps that talk to Appwrite for users, data, files, and subscriptions.
When should I use appwrite-typescript?
During Build when scaffolding auth, TablesDB access, storage uploads, realtime listeners, or server admin with API keys—especially when switching between client and node-appwrite packages.
Is appwrite-typescript safe to install?
Review the Security Audits panel on this Prism page and treat server API keys as secrets; the skill describes admin access patterns that must stay off the client.
SKILL.md
READMESKILL.md - Appwrite Typescript
# Appwrite TypeScript SDK ## Installation ```bash # Web npm install appwrite # React Native npm install react-native-appwrite # Node.js / Deno npm install node-appwrite ``` ## Setting Up the Client ### Client-side (Web / React Native) ```typescript // Web import { Client, Account, TablesDB, Storage, ID, Query } from 'appwrite'; // React Native import { Client, Account, TablesDB, Storage, ID, Query } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject('[PROJECT_ID]'); ``` ### Server-side (Node.js / Deno) ```typescript import { Client, Users, TablesDB, Storage, Functions, ID, Query } from 'node-appwrite'; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject(process.env.APPWRITE_PROJECT_ID) .setKey(process.env.APPWRITE_API_KEY); ``` ## Code Examples ### Authentication (client-side) ```typescript const account = new Account(client); // Email signup await account.create({ userId: ID.unique(), email: 'user@example.com', password: 'password123', name: 'User Name' }); // Email login const session = await account.createEmailPasswordSession({ email: 'user@example.com', password: 'password123' }); // OAuth login (Web) account.createOAuth2Session({ provider: OAuthProvider.Github, success: 'https://example.com/success', failure: 'https://example.com/fail', scopes: ['repo', 'user'] // optional — provider-specific scopes }); // Get current user const user = await account.get(); // Logout await account.deleteSession({ sessionId: 'current' }); ``` ### OAuth 2 Login (React Native) > **Important:** `createOAuth2Session()` does **not** work on React Native. You must use `createOAuth2Token()` with deep linking instead. #### Setup Install the required dependencies: ```bash npx expo install react-native-appwrite react-native-url-polyfill npm install expo-auth-session expo-web-browser expo-linking ``` Set the URL scheme in your `app.json`: ```json { "expo": { "scheme": "appwrite-callback-[PROJECT_ID]" } } ``` #### OAuth Flow ```typescript import { Client, Account, OAuthProvider } from 'react-native-appwrite'; import { makeRedirectUri } from 'expo-auth-session'; import * as WebBrowser from 'expo-web-browser'; const client = new Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') .setProject('[PROJECT_ID]'); const account = new Account(client); async function oauthLogin(provider: OAuthProvider) { // Create deep link that works across Expo environments const deepLink = new URL(makeRedirectUri({ preferLocalhost: true })); const scheme = `${deepLink.protocol}//`; // e.g. 'exp://' or 'appwrite-callback-[PROJECT_ID]://' // Get the OAuth login URL const loginUrl = await account.createOAuth2Token({ provider, success: `${deepLink}`, failure: `${deepLink}`, }); // Open browser and listen for the scheme redirect const result = await WebBrowser.openAuthSessionAsync(`${loginUrl}`, scheme); if (result.type !== 'success') return; // Extract credentials from the redirect URL const url = new URL(result.url); const secret = url.searchParams.get('secret'); const userId = url.searchParams.get('userId'); // Create session with the OAuth credentials await account.createSession({ userId, secret }); } // Usage await oauthLogin(OAuthProvider.Github); await oauthLogin(OAuthProvider.Google); ``` ### User Management (server-side) ```types