Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Nov 28, 2025

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

Summary by CodeRabbit

Release Notes v21.5.0

  • New Features

    • Added getScreenshot method to Avatars service with support for multiple output formats, viewport configuration, theming, geolocation, and quality settings
    • Added Theme, Timezone, and Output enums for screenshot customization
  • Bug Fixes

    • Fixed MFA challenge API endpoint paths
  • Chores

    • Version bumped to 21.5.0
    • Updated development dependencies

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

Adds Appwrite SDK version 21.5.0. Introduces Avatars.getScreenshot with an object-based signature (plus a deprecated variadic form) that builds a screenshot URL from many optional parameters and returns the URI string. Adds three exported enums: Theme, Timezone (comprehensive IANA list), and Output. Updates package version and devDependency playwright, updates client default x-sdk-version header, README CDN tag, and CHANGELOG. Adds a TypeScript docs example for getScreenshot. Also updates four account MFA endpoints to use /account/mfa/challenges.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • src/services/avatars.ts: new getScreenshot overloads, parameter validation, payload flattening, URL/query construction, and backward-compatibility handling.
  • src/enums/timezone.ts: very large enum — verify correctness and consistent formatting of IANA identifiers.
  • src/enums/theme.ts and src/enums/output.ts + src/index.ts: exports wiring and enum typings.
  • src/services/account.ts: changed API paths for MFA endpoints — ensure correctness and consistency with server API.
  • src/client.ts: x-sdk-version header update.
  • package.json: version bump and playwright devDependency update.
  • README.md, CHANGELOG.md, docs/examples/avatars/get-screenshot.md: documentation and example accuracy.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Web SDK update for version 21.5.0' directly reflects the main change: a version bump and associated updates for the SDK release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28caebc and 70b4d95.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • docs/examples/avatars/get-screenshot.md (1 hunks)
  • src/services/account.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/examples/avatars/get-screenshot.md

10-10: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (3)
docs/examples/avatars/get-screenshot.md (2)

15-32: ✅ Parameter values have been appropriately corrected.

The example parameters are now realistic and practical for developers:

  • Viewport dimensions (1920×1080) are standard screen sizes
  • Scale (2) is reasonable for resolution multiplication
  • Image dimensions (800×600) are valid pixel values
  • Quality (85) falls within the expected 0–100 range

This addresses the previous review feedback about unrealistic edge-case values. The example is now directly applicable without requiring parameter adjustments.


1-7: Example setup is clear and correct.

Client initialization follows Appwrite conventions, and the Avatars instantiation properly accepts the configured client. Imports include all necessary enums (Theme, Timezone, Output) for the example.

src/services/account.ts (1)

796-832: MFA challenge routes pluralized consistently across all overloads

The four MFA challenge endpoints (createMfaChallenge, createMFAChallenge, updateMfaChallenge, updateMFAChallenge) all correctly target /account/mfa/challenges (lines 815, 870, 934, 1000), with POST for create and PUT for update. Deprecated and non-deprecated overloads remain aligned. No references to the old singular path exist in the codebase.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/services/avatars.ts (1)

571-577: Minor documentation inconsistency: boolean params described as 0/1.

The JSDoc describes fullpage and touch as "Pass 0 for ... or 1 for ..." but the TypeScript type is boolean. Consider aligning the documentation with the type (e.g., "Pass true for full page capture, or false for viewport only").

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de72141 and 28caebc.

📒 Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • README.md (1 hunks)
  • docs/examples/avatars/get-screenshot.md (1 hunks)
  • package.json (2 hunks)
  • src/client.ts (1 hunks)
  • src/enums/output.ts (1 hunks)
  • src/enums/theme.ts (1 hunks)
  • src/enums/timezone.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/services/avatars.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/enums/theme.ts (1)
src/index.ts (1)
  • Theme (32-32)
src/enums/output.ts (1)
src/index.ts (1)
  • Output (34-34)
src/enums/timezone.ts (1)
src/index.ts (1)
  • Timezone (33-33)
🔇 Additional comments (11)
src/client.ts (1)

323-323: LGTM! Version header updated correctly.

The SDK version header has been properly updated to 21.5.0, aligning with the version bump across the repository.

package.json (2)

5-5: LGTM! Version bumped to 21.5.0.

The package version has been properly updated to 21.5.0, consistent with the SDK version changes.


29-29: Playwright is not actively used in this codebase; no test suite exists to be affected by breaking changes.

Investigation found that while Playwright 1.56.1 is listed as a devDependency in package.json, it is not invoked by any npm scripts (which only include build, build:types, and build:libs), not used in any CI workflows, and the codebase contains no test files or test runner. The "Browser" reference found in the code is an enum in the avatars service, not Playwright. Since this is an SDK with no active test infrastructure using Playwright, the documented breaking changes (route glob patterns, Cookie headers, deprecated APIs, background page events) have no practical impact on this repository.

Likely an incorrect or invalid review comment.

README.md (1)

36-36: LGTM! CDN URL updated to version 21.5.0.

The CDN script URL has been properly updated to reference the new version, maintaining consistency with the release.

CHANGELOG.md (1)

3-6: LGTM! Changelog entry properly documents the new feature.

The changelog entry for version 21.5.0 clearly documents the addition of the getScreenshot method, following the established format and structure.

src/enums/theme.ts (1)

1-4: LGTM! Clean enum implementation.

The Theme enum is simple and well-defined with appropriate Light and Dark values for screenshot theming.

src/index.ts (1)

32-34: LGTM! New enums properly exported.

The three new enums (Theme, Timezone, Output) have been correctly added to the public API exports, following the established pattern for enum exports.

src/enums/output.ts (1)

1-9: LGTM! Comprehensive image format enum.

The Output enum provides a good range of image formats, covering both legacy formats (JPEG, PNG, GIF) and modern formats (WebP, AVIF, HEIC).

src/services/avatars.ts (2)

8-10: LGTM!

New enum imports are correctly added and align with the new getScreenshot method requirements.


620-752: LGTM!

The implementation correctly follows the established SDK patterns:

  • Proper parameter normalization between object and positional styles
  • Required parameter validation for url
  • Consistent payload construction and URL building
src/enums/timezone.ts (1)

1-421: Now let me check the Appwrite API documentation directly:

web_search
Appwrite getScreenshot timezone parameter API documentation official

@ChiragAgg5k ChiragAgg5k merged commit d915592 into main Dec 2, 2025
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.

3 participants