{"id":48733,"library":"node-appwrite","title":"Appwrite Node.js SDK","description":"Official Node.js SDK for Appwrite, an open-source backend-as-a-service platform that simplifies common backend tasks like authentication, database, storage, and serverless functions via a REST API. Current version 26.1.0 supports Appwrite server 1.9.x. Released weekly, with major versions aligning to server API updates. Key differentiators: self-hosted, full control over data, built-in permissions and security, real-time capabilities, and cross-platform SDKs. TypeScript types are included. ESM and CJS dual support. Over 150k weekly npm downloads.","status":"active","version":"26.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/appwrite/sdk-for-node","tags":["javascript","typescript"],"install":[{"cmd":"npm install node-appwrite","lang":"bash","label":"npm"},{"cmd":"yarn add node-appwrite","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-appwrite","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default.","wrong":"import Client from 'node-appwrite'","symbol":"Client","correct":"import { Client } from 'node-appwrite'"},{"note":"CJS require works but ESM import recommended. The SDK ships both ESM and CJS.","wrong":"const Users = require('node-appwrite').Users","symbol":"Users","correct":"import { Users } from 'node-appwrite'"},{"note":"Do not deep import; all exports are at package root.","wrong":"import { ID } from 'node-appwrite/lib/services'","symbol":"ID","correct":"import { ID } from 'node-appwrite'"},{"note":"Enums are re-exported from root, not from a separate module.","wrong":"import { ExecutionMethod } from 'node-appwrite/enums'","symbol":"Enum types (e.g., ExecutionMethod)","correct":"import { ExecutionMethod } from 'node-appwrite'"}],"quickstart":{"code":"import { Client, Users, ID } from 'node-appwrite';\n\nconst client = new Client();\nclient\n    .setEndpoint('https://[HOSTNAME_OR_IP]/v1')\n    .setProject('PROJECT_ID')\n    .setKey('API_KEY');\n\nconst users = new Users(client);\n\nasync function createUser() {\n    try {\n        const user = await users.create(\n            ID.unique(),\n            'user@example.com',\n            '+1234567890',\n            'password123',\n            'Walter O\\'Brien'\n        );\n        console.log('User created:', user);\n    } catch (error) {\n        console.error('Error creating user:', error);\n    }\n}\n\ncreateUser();","lang":"typescript","description":"Initializes the client, creates a Users service, and creates a new user with unique ID."},"warnings":[{"fix":"Replace .setApiKey(key) with .setKey(key)","message":"In v21, Client.setKey() was renamed from Client.setApiKey(). Using setApiKey() will throw a type error in TypeScript, but in JavaScript it will silently fail (function not exist).","severity":"breaking","affected_versions":">=21.0.0"},{"fix":"Update code to use async/await or .then() (promises still supported). Callback patterns (success, error) are no longer accepted.","message":"In v26, the previously deprecated ID.unique() was removed. ID.unique() is no longer available. Use ID.custom() with a unique string or generate your own.","severity":"breaking","affected_versions":">=25.0.0"},{"fix":"Remove .setSelfSigned() calls. For development, use environment variable APPWRITE_SELF_SIGNED=1 or set via client configuration.","message":"Client.setSelfSigned() is deprecated since v23. Use .setSelfSigned(false) with a valid certificate or disable self-signed in production.","severity":"deprecated","affected_versions":">=23.0.0"},{"fix":"Always provide generic parameter: db.listDocuments<MyType>('collectionId')","message":"When using TypeScript, service methods that accept generic types (e.g., Databases.listDocuments<T>()) require the generic type to be passed explicitly because TypeScript cannot infer it from the response body alone.","severity":"gotcha","affected_versions":"*"},{"fix":"Set the environment variable NODE_APPWRITE_FETCH to 'native' to use the built-in fetch in Node 18+ and avoid conflicts.","message":"In Node.js environments, the SDK defaults to using cross-fetch for HTTP requests. This can conflict with custom fetch polyfills or global fetch in newer Node versions, causing inexplicable SSL errors.","severity":"gotcha","affected_versions":">=18.0.0"}],"env_vars":null,"search_vec":"'1.9':41 '150k':87 '26.1.0':37 'align':48 'api':34,51 'appwrit':1,8,39 'authent':25 'backend':14,22 'backend-as-a-servic':13 'built':63 'built-in':62 'capabl':71 'cjs':83 'common':21 'control':59 'cross':74 'cross-platform':73 'current':35 'data':61 'databas':26 'differenti':54 'download':90 'dual':84 'esm':81 'full':58 'function':30 'host':57 'includ':80 'javascript':91 'key':53 'like':24 'major':46 'node.js':2,5 'npm':89 'offici':4 'open':11 'open-sourc':10 'permiss':65 'platform':18,75 'real':69 'real-tim':68 'releas':43 'rest':33 'sdk':3,6 'sdks':76 'secur':67 'self':56 'self-host':55 'server':40,50 'serverless':29 'servic':17 'simplifi':20 'sourc':12 'storag':27 'support':38,85 'task':23 'time':70 'type':78 'typescript':77,92 'updat':52 'version':36,47 'via':31 'week':44,88 'x':42","created_at":"2026-06-07T16:58:11.612185+00:00","updated_at":"2026-06-07T16:58:11.612185+00:00","problems":[{"fix":"Verify .setEndpoint() and .setProject() values. Ensure project ID is from Appwrite console (not project name).","cause":"Incorrect project ID or endpoint URL when initializing the client.","error":"Error: AppwriteException: Project not found (404)"},{"fix":"Ensure Client is instantiated and configured before creating services: const users = new Users(client);","cause":"Service instantiated before Client is ready or imported incorrectly (e.g., using Users class without importing).","error":"TypeError: Cannot read properties of undefined (reading 'create')"},{"fix":"Check Appwrite server is running and endpoint matches: use http://localhost/v1 for local dev without SSL.","cause":"Local Appwrite server not running or incorrect endpoint (e.g., using https://localhost instead of http://localhost or wrong port).","error":"Error: Network request failed: connect ECONNREFUSED [::1]:443"},{"fix":"Generate a new API key in Appwrite console with appropriate scopes, and pass it via .setKey(key).","cause":"API key missing, expired, or does not have required permissions for the operation.","error":"Error: AppwriteException: Unauthorized (401)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://appwrite.io/support","github":"https://github.com/appwrite/sdk-for-node","docs":null,"changelog":null,"pypi":null,"npm":"node-appwrite","openapi_spec":null,"status_page":null,"smithery":null,"categories":["backend"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}