Skip to content

feat: Web SDK update for version 23.0.0#159

Merged
ChiragAgg5k merged 8 commits into
mainfrom
dev
Mar 3, 2026
Merged

feat: Web SDK update for version 23.0.0#159
ChiragAgg5k merged 8 commits into
mainfrom
dev

Conversation

@premtsd-code

@premtsd-code premtsd-code commented Feb 24, 2026

Copy link
Copy Markdown

This PR contains updates to the Web SDK for version 23.0.0.

@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds an optional ttl?: number parameter to Databases.listDocuments and TablesDB.listRows (object and positional overloads) and includes ttl in outgoing GET payloads. Changes Channel API to require explicit non-empty string IDs for several static factories and instance route methods (removes wildcard defaults and normalizes/validates IDs). Updates SDK version string and README CDN reference to 23.0.0, adjusts small inline JSDoc/comments in models and teams, and updates example docs to pass ttl: 0 in listing examples.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Web SDK update for version 23.0.0' accurately describes the main change: a comprehensive SDK version bump to 23.0.0 with corresponding updates to version numbers, dependencies, and API enhancements (TTL parameters, Channel ID validations).
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/models.ts`:
- Line 246: The change of Models.Row.$sequence and Models.Document.$sequence
from number to string is a breaking API change; to keep this patch release safe,
revert those fields to the previous type or make them backward-compatible by
changing the declarations for $sequence in models.ts (the Model Row and Document
interfaces/classes) to a union type (number | string) and update any related
type tests or usages (e.g., places referencing Models.Row.$sequence and
Models.Document.$sequence) to accept both types; if you intend a breaking change
instead, prepare a major-version bump and add migration notes/changelog entries
rather than shipping it in a patch.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4051c5 and 42b87bb.

📒 Files selected for processing (1)
  • src/models.ts

Comment thread src/models.ts Outdated
* Row sequence ID.
*/
$sequence: number;
$sequence: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Public $sequence type change is breaking for patch consumers

Changing Models.Row.$sequence (Line 246) and Models.Document.$sequence (Line 285) from number to string is a breaking TypeScript API change and can fail downstream builds in a 22.4.1 patch upgrade. Please either ship this as a major-version break with migration notes, or keep this release backward-compatible.

Backward-compatible patch-safe option
 export type Row = {
@@
-        $sequence: string;
+        $sequence: number | string;
@@
 export type Document = {
@@
-        $sequence: string;
+        $sequence: number | string;

Also applies to: 285-285

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/models.ts` at line 246, The change of Models.Row.$sequence and
Models.Document.$sequence from number to string is a breaking API change; to
keep this patch release safe, revert those fields to the previous type or make
them backward-compatible by changing the declarations for $sequence in models.ts
(the Model Row and Document interfaces/classes) to a union type (number |
string) and update any related type tests or usages (e.g., places referencing
Models.Row.$sequence and Models.Document.$sequence) to accept both types; if you
intend a breaking change instead, prepare a major-version bump and add migration
notes/changelog entries rather than shipping it in a patch.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/enums/timezone.ts (1)

49-285: ⚠️ Potential issue | 🟠 Major

Timezone enum renames constitute a breaking API change for external consumers.

The four renamed members (AfricaPortonovoAfricaPortoNovo, AmericaBlancsablonAmericaBlancSablon, AmericaPortauprinceAmericaPortAuPrince, AsiaUstneraAsiaUstNera) will cause TypeScript compile failures for any consumer referencing the old names. This is a major version-bump requirement, not a patch-compatible change.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/timezone.ts` around lines 49 - 285, The enum member renames are a
breaking API change; restore backward compatibility by keeping the new correct
members (AfricaPortoNovo, AmericaBlancSablon, AmericaPortAuPrince, AsiaUstNera)
and add deprecated aliases that map the old names (AfricaPortonovo,
AmericaBlancsablon, AmericaPortauprince, AsiaUstnera) to the same string values
or export const aliases so existing consumers still compile; update any enum
usage comments and mark the old aliases as deprecated for removal in the next
major version.
🧹 Nitpick comments (1)
src/enums/browser-permission.ts (1)

21-21: Consider XRSpatialTracking over XrSpatialTracking.

XR (Extended Reality) is a well-established W3C/industry acronym (see the WebXR Device API). The current rename treats it as a normal title-cased word (Xr), whereas other SDK enum members using USB and MIDI are capitalized as Usb and Midi for consistency. Whether the right call here is XRSpatialTracking or XrSpatialTracking (staying consistent with the existing Usb/Midi style) is worth a deliberate decision, but XrSpatialTracking as written may look unusual to developers familiar with WebXR.

♻️ Proposed rename
-    XrSpatialTracking = 'xr-spatial-tracking',
+    XRSpatialTracking = 'xr-spatial-tracking',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/browser-permission.ts` at line 21, Rename the enum member
XrSpatialTracking to XRSpatialTracking in the BrowserPermission enum and update
all references/usages (imports, switches, tests, serialization/deserialization)
accordingly; keep the enum value string as 'xr-spatial-tracking' (i.e., change
only the identifier, not the literal) so external wire-format stays stable, and
run/type-check to ensure no remaining references to XrSpatialTracking remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/enums/browser-permission.ts`:
- Around line 8-21: Public enum BrowserPermission was changed by renaming
members (e.g., Clipboardread → ClipboardRead, Clipboardwrite → ClipboardWrite,
etc.), which breaks consumers; restore backward compatibility by adding
deprecated aliases that map the old member names to the new string values within
the BrowserPermission enum (e.g., include Clipboardread =
BrowserPermission.ClipboardRead style aliases or duplicate enum entries with the
old identifiers assigned the same string), mark them deprecated in comments, and
update any exported types/docs to mention the new names; ensure the enum retains
the new canonical members (ClipboardRead, ClipboardWrite, PaymentHandler, Usb,
Bluetooth, Accelerometer, Gyroscope, Magnetometer, AmbientLightSensor,
BackgroundSync, PersistentStorage, ScreenWakeLock, WebShare, XrSpatialTracking)
while providing old-name aliases so external TypeScript code continues to
compile.

In `@src/enums/image-gravity.ts`:
- Around line 3-10: Restore backward compatibility by reintroducing the
old-cased enum members as aliases that point to the same string values while
keeping the new-cased members; e.g., add duplicate enum entries (Topleft =
'top-left', Topright = 'top-right', Bottomleft = 'bottom-left', Bottomright =
'bottom-right') alongside TopLeft/TopRight/BottomLeft/BottomRight so consumers
using either identifier compile, and mark the old names as deprecated in
comments; then ensure the package version is bumped to a minor release and add a
short migration note documenting the preferred new member names and the
temporary aliases.

---

Outside diff comments:
In `@src/enums/timezone.ts`:
- Around line 49-285: The enum member renames are a breaking API change; restore
backward compatibility by keeping the new correct members (AfricaPortoNovo,
AmericaBlancSablon, AmericaPortAuPrince, AsiaUstNera) and add deprecated aliases
that map the old names (AfricaPortonovo, AmericaBlancsablon,
AmericaPortauprince, AsiaUstnera) to the same string values or export const
aliases so existing consumers still compile; update any enum usage comments and
mark the old aliases as deprecated for removal in the next major version.

---

Nitpick comments:
In `@src/enums/browser-permission.ts`:
- Line 21: Rename the enum member XrSpatialTracking to XRSpatialTracking in the
BrowserPermission enum and update all references/usages (imports, switches,
tests, serialization/deserialization) accordingly; keep the enum value string as
'xr-spatial-tracking' (i.e., change only the identifier, not the literal) so
external wire-format stays stable, and run/type-check to ensure no remaining
references to XrSpatialTracking remain.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42b87bb and 89c1885.

📒 Files selected for processing (3)
  • src/enums/browser-permission.ts
  • src/enums/image-gravity.ts
  • src/enums/timezone.ts

Comment thread src/enums/browser-permission.ts Outdated
Comment on lines +8 to +21
ClipboardRead = 'clipboard-read',
ClipboardWrite = 'clipboard-write',
PaymentHandler = 'payment-handler',
Usb = 'usb',
Bluetooth = 'bluetooth',
Accelerometer = 'accelerometer',
Gyroscope = 'gyroscope',
Magnetometer = 'magnetometer',
Ambientlightsensor = 'ambient-light-sensor',
Backgroundsync = 'background-sync',
Persistentstorage = 'persistent-storage',
Screenwakelock = 'screen-wake-lock',
Webshare = 'web-share',
Xrspatialtracking = 'xr-spatial-tracking',
AmbientLightSensor = 'ambient-light-sensor',
BackgroundSync = 'background-sync',
PersistentStorage = 'persistent-storage',
ScreenWakeLock = 'screen-wake-lock',
WebShare = 'web-share',
XrSpatialTracking = 'xr-spatial-tracking',

Copy link
Copy Markdown

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:

# First, let's check the structure and find the file
find . -name "browser-permission.ts" -type f

Repository: appwrite/sdk-for-web

Length of output: 97


🏁 Script executed:

# Run the verification script to search for old member name references
rg -n --type ts "(BrowserPermission\.(Clipboardread|Clipboardwrite|Paymenthandler|Ambientlightsensor|Backgroundsync|Persistentstorage|Screenwakelock|Webshare|Xrspatialtracking))"

Repository: appwrite/sdk-for-web

Length of output: 46


🏁 Script executed:

# Let's also read the actual browser-permission.ts file to see the current state
cat -n src/enums/browser-permission.ts

Repository: appwrite/sdk-for-web

Length of output: 929


No internal references to old BrowserPermission member names remain—internal migration is complete.

This is a breaking API change: renaming public enum members (Clipboardread → ClipboardRead, Clipboardwrite → ClipboardWrite, etc.) will produce TypeScript compile errors in external consumer code using the old identifiers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/browser-permission.ts` around lines 8 - 21, Public enum
BrowserPermission was changed by renaming members (e.g., Clipboardread →
ClipboardRead, Clipboardwrite → ClipboardWrite, etc.), which breaks consumers;
restore backward compatibility by adding deprecated aliases that map the old
member names to the new string values within the BrowserPermission enum (e.g.,
include Clipboardread = BrowserPermission.ClipboardRead style aliases or
duplicate enum entries with the old identifiers assigned the same string), mark
them deprecated in comments, and update any exported types/docs to mention the
new names; ensure the enum retains the new canonical members (ClipboardRead,
ClipboardWrite, PaymentHandler, Usb, Bluetooth, Accelerometer, Gyroscope,
Magnetometer, AmbientLightSensor, BackgroundSync, PersistentStorage,
ScreenWakeLock, WebShare, XrSpatialTracking) while providing old-name aliases so
external TypeScript code continues to compile.

Comment thread src/enums/image-gravity.ts Outdated
Comment on lines +3 to +10
TopLeft = 'top-left',
Top = 'top',
Topright = 'top-right',
TopRight = 'top-right',
Left = 'left',
Right = 'right',
Bottomleft = 'bottom-left',
BottomLeft = 'bottom-left',
Bottom = 'bottom',
Bottomright = 'bottom-right',
BottomRight = 'bottom-right',

Copy link
Copy Markdown

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:

cat -n src/enums/image-gravity.ts

Repository: appwrite/sdk-for-web

Length of output: 392


🏁 Script executed:

rg -n "(Topleft|Topright|Bottomleft|Bottomright)" --type ts

Repository: appwrite/sdk-for-web

Length of output: 46


🏁 Script executed:

cat package.json | grep -A 2 -B 2 '"version"'

Repository: appwrite/sdk-for-web

Length of output: 364


Breaking public API change shipped as a patch version.

Renaming exported enum members (TopleftTopLeft, ToprightTopRight, BottomleftBottomLeft, BottomrightBottomRight) is a TypeScript compile-breaking change for any downstream consumer referencing the old member names. Modifying existing enums by renaming values breaks backward compatibility. Internal code has been correctly updated, but external consumers using the old member names will experience compilation failures.

This change is versioned as 22.4.1 (patch). Under semver, a patch increment signals only backward-compatible bug fixes; renaming public API identifiers warrants at minimum a minor version bump (e.g., 22.5.0) and should be accompanied by a migration guide for consumers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/enums/image-gravity.ts` around lines 3 - 10, Restore backward
compatibility by reintroducing the old-cased enum members as aliases that point
to the same string values while keeping the new-cased members; e.g., add
duplicate enum entries (Topleft = 'top-left', Topright = 'top-right', Bottomleft
= 'bottom-left', Bottomright = 'bottom-right') alongside
TopLeft/TopRight/BottomLeft/BottomRight so consumers using either identifier
compile, and mark the old names as deprecated in comments; then ensure the
package version is bumped to a minor release and add a short migration note
documenting the preferred new member names and the temporary aliases.

@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Web SDK update for version 22.4.1 feat: Web SDK update for version 22.4.2 Mar 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

9-9: Vague compatibility statement may confuse users.

Changing from a specific server version ("1.8.x") to "latest" reduces clarity for users who need to match SDK versions with their Appwrite server. Consider keeping a specific version reference or linking to a compatibility matrix.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 9, Replace the vague "latest" compatibility statement in
README.md with a specific Appwrite server version (e.g., "1.8.x") and/or add a
link to a compatibility matrix; update the sentence that currently reads "**This
SDK is compatible with Appwrite server version latest...**" to explicitly state
the supported server version(s) and include a URL to a compatibility matrix or
release notes so consumers can match SDK and server releases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/channel.ts`:
- Around line 98-124: Add a documented breaking change to CHANGELOG.md
describing that Channel factory methods now require an explicit id and no longer
default to "*" — specifically mention Channel.database, Channel.execution,
Channel.tablesdb, Channel.bucket, Channel.function, Channel.team,
Channel.membership and related factory methods like collection() and table()
which removed optional ID/wildcard behavior; state the user impact, migration
guidance (pass explicit id or use a separate wildcard helper if needed), and the
PR/commit reference for traceability.

In `@src/services/teams.ts`:
- Line 402: Revert the JSDoc descriptions for the {string[]} params.roles
occurrences to state "each 32 characters long" (instead of 81) so they match the
Appwrite Teams API constraint; update every JSDoc block that documents
params.roles (search for "params.roles" in this file and the surrounding comment
blocks) to mention a maximum of 100 roles and that each role is 32 characters
long.

---

Nitpick comments:
In `@README.md`:
- Line 9: Replace the vague "latest" compatibility statement in README.md with a
specific Appwrite server version (e.g., "1.8.x") and/or add a link to a
compatibility matrix; update the sentence that currently reads "**This SDK is
compatible with Appwrite server version latest...**" to explicitly state the
supported server version(s) and include a URL to a compatibility matrix or
release notes so consumers can match SDK and server releases.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89c1885 and bccf028.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • README.md
  • docs/examples/databases/list-documents.md
  • docs/examples/tablesdb/list-rows.md
  • package.json
  • src/channel.ts
  • src/client.ts
  • src/models.ts
  • src/services/databases.ts
  • src/services/tables-db.ts
  • src/services/teams.ts
💤 Files with no reviewable changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/models.ts

Comment thread src/channel.ts
Comment thread src/services/teams.ts
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Web SDK update for version 22.4.2 feat: Web SDK update for version 22.4.1 Mar 3, 2026
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Web SDK update for version 22.4.1 feat: Web SDK update for version 22.4.2 Mar 3, 2026
@ArnabChatterjee20k ArnabChatterjee20k changed the title feat: Web SDK update for version 22.4.2 feat: Web SDK update for version 23.0.0 Mar 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/client.ts (1)

395-395: Use a single source for SDK version metadata.

Line 395 hardcodes the SDK version in headers, which duplicates release metadata and can drift over time. Consider injecting this value from a build-time constant tied to package.json version.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` at line 395, Replace the hardcoded 'x-sdk-version': '23.0.0'
header in src/client.ts with a single source constant (e.g., SDK_VERSION) that
is populated at build time from package.json version; update the header
assignment that sets 'x-sdk-version' to use SDK_VERSION, add (or import) the
SDK_VERSION constant (populated via your build system or from
process.env.npm_package_version or a generated constants module), and ensure the
build pipeline injects the package.json version so the value cannot drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/client.ts`:
- Line 395: Replace the hardcoded 'x-sdk-version': '23.0.0' header in
src/client.ts with a single source constant (e.g., SDK_VERSION) that is
populated at build time from package.json version; update the header assignment
that sets 'x-sdk-version' to use SDK_VERSION, add (or import) the SDK_VERSION
constant (populated via your build system or from
process.env.npm_package_version or a generated constants module), and ensure the
build pipeline injects the package.json version so the value cannot drift.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00c9f4f and 214d443.

📒 Files selected for processing (3)
  • README.md
  • package.json
  • src/client.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

@ChiragAgg5k ChiragAgg5k merged commit cf65e76 into main Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants