Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@ on:
types: [published]
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup Node.js environment
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22'
registry-url: 'https://registry.npmjs.org'

# Determine release tag based on the tag name
- name: Update npm to latest version for OIDC support
run: npm install -g npm@latest

- name: Determine release tag
id: release_tag
run: |
Expand All @@ -29,14 +34,10 @@ jobs:
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi

# Install dependencies (if any) and build your project (if necessary)
- name: Install dependencies and build
run: |
npm install
npm run build

# Publish to NPM with the appropriate tag
- name: Publish
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_NO_ORG }}
run: npm publish --provenance --access public --tag ${{ steps.release_tag.outputs.tag }}
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Change Log

## 21.1.1

* Update SDK as per latest server specs, these include -
* Updates to Runtime enums
* `Output` is now renamed to `ImageFormat` - Note that this is a breaking change
* Introduces Backups module for managing Database backups
* Introduces Organization module

Comment on lines +3 to +10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Read the CHANGELOG.md file to examine the actual structure and indentation
head -50 CHANGELOG.md

Repository: appwrite/sdk-for-node

Length of output: 1706


🏁 Script executed:

# Check for markdown linting configuration files
fd -e json -e yaml -e yml | xargs grep -l "markdownlint\|MD007" 2>/dev/null || echo "No linting config found with grep"
ls -la | grep -E "markdownlint|eslint"

Repository: appwrite/sdk-for-node

Length of output: 182


🏁 Script executed:

# Look for any documentation about versioning
fd -e md | xargs grep -l "semver\|semantic.*version\|breaking.*change" 2>/dev/null | head -10

Repository: appwrite/sdk-for-node

Length of output: 77


🏁 Script executed:

# Read the markdownlint configuration
cat coderabbit.markdownlint-cli2.jsonc

Repository: appwrite/sdk-for-node

Length of output: 543


🏁 Script executed:

# Check if there's any semver or release documentation
fd -e md | xargs grep -i "breaking\|semver\|version" 2>/dev/null | grep -v node_modules | head -20

Repository: appwrite/sdk-for-node

Length of output: 1084


🏁 Script executed:

# Look at more context around version releases to understand versioning strategy
grep -A 5 "^## [0-9]" CHANGELOG.md | head -80

Repository: appwrite/sdk-for-node

Length of output: 2485


Fix MD007 list indentation and correct version bump for breaking change.

The nested bullets under 21.1.1 use 4-space indentation, which violates MD007 (default rule requires 2-space). Additionally, the changelog explicitly documents a breaking change (OutputImageFormat rename), which should bump the minor version to 21.2.0, not the patch version, per semver conventions used elsewhere in this project (e.g., 21.0.0 and 16.0.0 for breaking changes).

Proposed formatting fix
 ## 21.1.1
-
-* Update SDK as per latest server specs, these include -
-    * Updates to Runtime enums
-    * `Output` is now renamed to `ImageFormat` - Note that this is a breaking change
-    * Introduces Backups module for managing Database backups
-    * Introduces Organization module
+* Update SDK as per latest server specs, these include:
+  * Updates to Runtime enums
+  * `Output` is now renamed to `ImageFormat` - Note that this is a breaking change
+  * Introduces Backups module for managing Database backups
+  * Introduces Organization module
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

6-6: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


7-7: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


8-8: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


9-9: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

🤖 Prompt for AI Agents
In `@CHANGELOG.md` around lines 3 - 10, Update the CHANGELOG.md entry: change the
header from "## 21.1.1" to "## 21.2.0" to reflect the breaking change, and fix
MD007 by converting the nested bullet indentation under that header from 4
spaces to 2 spaces; ensure the line that documents the rename uses the exact
symbols "Output" and "ImageFormat" (e.g., "`Output` is now renamed to
`ImageFormat` - Note that this is a breaking change") so the breaking change is
clearly recorded under the new 21.2.0 heading.

## 21.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 21.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType)
and `reference` parameters
* Add `getScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

Expand Down Expand Up @@ -54,7 +63,8 @@
## 16.0.0

* Fix: remove content-type from GET requests
* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` methods (changes their positioning in method definition)
* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute`
methods (changes their positioning in method definition)

## 15.0.1

Expand Down Expand Up @@ -96,4 +106,5 @@
* Rename `templateBranch` to `templateVersion` in `createFunction()`.
* Rename `downloadDeployment()` to `getDeploymentDownload()`

> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.
> You can find the new syntax for breaking changes in
> the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2026 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Appwrite Node.js SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).**

> This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code.
If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web)

Appwrite is an open-source backend as a service server that abstract and simplify 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 Node.js 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 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 Node.js 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)

Expand Down
4 changes: 3 additions & 1 deletion docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ const client = new sdk.Client()

const account = new sdk.Account(client);

const result = await account.createJWT();
const result = await account.createJWT({
duration: 0 // optional
});
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ const result = await avatars.getScreenshot({
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: sdk.Output.Jpg // optional
output: sdk.ImageFormat.Jpg // optional
});
13 changes: 13 additions & 0 deletions docs/examples/backups/create-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.createArchive({
services: [],
resourceId: '<RESOURCE_ID>' // optional
});
18 changes: 18 additions & 0 deletions docs/examples/backups/create-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.createPolicy({
policyId: '<POLICY_ID>',
services: [],
retention: 1,
schedule: '',
name: '<NAME>', // optional
resourceId: '<RESOURCE_ID>', // optional
enabled: false // optional
});
15 changes: 15 additions & 0 deletions docs/examples/backups/create-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.createRestoration({
archiveId: '<ARCHIVE_ID>',
services: [],
newResourceId: '<NEW_RESOURCE_ID>', // optional
newResourceName: '<NEW_RESOURCE_NAME>' // optional
});
12 changes: 12 additions & 0 deletions docs/examples/backups/delete-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.deleteArchive({
archiveId: '<ARCHIVE_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/backups/delete-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.deletePolicy({
policyId: '<POLICY_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/backups/get-archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.getArchive({
archiveId: '<ARCHIVE_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/backups/get-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.getPolicy({
policyId: '<POLICY_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/backups/get-restoration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.getRestoration({
restorationId: '<RESTORATION_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/backups/list-archives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.listArchives({
queries: [] // optional
});
12 changes: 12 additions & 0 deletions docs/examples/backups/list-policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.listPolicies({
queries: [] // optional
});
12 changes: 12 additions & 0 deletions docs/examples/backups/list-restorations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.listRestorations({
queries: [] // optional
});
16 changes: 16 additions & 0 deletions docs/examples/backups/update-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key

const backups = new sdk.Backups(client);

const result = await backups.updatePolicy({
policyId: '<POLICY_ID>',
name: '<NAME>', // optional
retention: 1, // optional
schedule: '', // optional
enabled: false // optional
});
8 changes: 7 additions & 1 deletion docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const result = await databases.updateDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 33,
"isAdmin": false
}, // optional
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
8 changes: 7 additions & 1 deletion docs/examples/databases/update-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ const databases = new sdk.Databases(client);
const result = await databases.updateDocuments({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
data: {}, // optional
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 33,
"isAdmin": false
}, // optional
queries: [], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
8 changes: 7 additions & 1 deletion docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const result = await databases.upsertDocument({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
}, // optional
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
12 changes: 12 additions & 0 deletions docs/examples/organizations/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

const organizations = new sdk.Organizations(client);

const result = await organizations.delete({
organizationId: '<ORGANIZATION_ID>'
});
12 changes: 12 additions & 0 deletions docs/examples/organizations/estimation-delete-organization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const sdk = require('node-appwrite');

const client = new sdk.Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with

const organizations = new sdk.Organizations(client);

const result = await organizations.estimationDeleteOrganization({
organizationId: '<ORGANIZATION_ID>'
});
8 changes: 7 additions & 1 deletion docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ const result = await tablesDB.updateRow({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // optional
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 33,
"isAdmin": false
}, // optional
permissions: [sdk.Permission.read(sdk.Role.any())], // optional
transactionId: '<TRANSACTION_ID>' // optional
});
Loading