Skip to content

feat: React Native SDK update for version 0.20.0#83

Merged
ChiragAgg5k merged 1 commit intomainfrom
dev
Feb 3, 2026
Merged

feat: React Native SDK update for version 0.20.0#83
ChiragAgg5k merged 1 commit intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Feb 3, 2026

This PR contains updates to the React Native SDK for version 0.20.0.

Summary by CodeRabbit

  • Documentation

    • Improved code examples across account, avatar, database, function, locale, messaging, storage, team, and tablesdb modules with syntax-highlighted formatting and explicit client initialization steps for better clarity and completeness.
  • Chores

    • Removed IIFE bundle format configuration from the build output.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Walkthrough

This pull request applies consistent formatting updates across 70+ documentation examples by wrapping code snippets in JavaScript code fences and enhancing examples with client configuration (setEndpoint and setProject calls). Additionally, the IIFE (immediately-invoked function expression) build output format is removed from the Rollup configuration, leaving only CommonJS and ES module formats.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims a React Native SDK update for version 0.20.0, but the changes are exclusively documentation markdown formatting (adding code fences) and removing an IIFE build output configuration. Revise the title to accurately reflect the primary change. Consider: 'docs: Add JavaScript code fences to documentation examples' or 'build: Remove IIFE output from rollup config' depending on which change is intended as the main focus.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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

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.

@ChiragAgg5k ChiragAgg5k merged commit 0e0c49a into main Feb 3, 2026
1 of 2 checks passed
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: 0

Caution

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

⚠️ Outside diff range comments (7)
docs/examples/databases/increment-document-attribute.md (1)

10-18: ⚠️ Potential issue | 🟡 Minor

Use a concrete placeholder for attribute instead of an empty string.

An empty string is ambiguous in docs and can confuse readers. Consider using a placeholder like <ATTRIBUTE> to make the example actionable.

✏️ Suggested doc tweak
-    attribute: '',
+    attribute: '<ATTRIBUTE>',
docs/examples/account/update-push-target.md (1)

1-15: ⚠️ Potential issue | 🟡 Minor

Wrap the example in an async function to avoid top‑level await pitfalls.

Some environments won’t allow top‑level await, and docs should be copy‑paste safe. Consider an async IIFE wrapper for this snippet.

✅ Suggested doc-safe wrapper
-const result = await account.updatePushTarget({
-    targetId: '<TARGET_ID>',
-    identifier: '<IDENTIFIER>'
-});
-
-console.log(result);
+(async () => {
+  const result = await account.updatePushTarget({
+      targetId: '<TARGET_ID>',
+      identifier: '<IDENTIFIER>'
+  });
+
+  console.log(result);
+})();
docs/examples/account/get-mfa-recovery-codes.md (1)

4-12: ⚠️ Potential issue | 🟡 Minor

Wrap the await call in an async context (Line 10).
Top‑level await isn’t valid in many JS runtimes and may confuse copy‑paste usage.

✅ Suggested doc-safe wrapper
-const result = await account.getMFARecoveryCodes();
-
-console.log(result);
+;(async () => {
+  const result = await account.getMFARecoveryCodes();
+  console.log(result);
+})();
docs/examples/account/create.md (1)

10-15: ⚠️ Potential issue | 🟡 Minor

Use a non-empty password placeholder in the example.

The password field requires 8–256 characters and cannot be an empty string. Replace password: '' with a placeholder like '<PASSWORD>' to prevent validation errors on copy-paste.

docs/examples/tablesdb/upsert-row.md (1)

21-21: ⚠️ Potential issue | 🔴 Critical

Critical syntax error in permissions parameter.

The permissions array contains a syntax error with unescaped quotes. The string "read("any")" inside the double-quoted context will cause a JavaScript syntax error because the inner double quotes prematurely terminate the string.

🐛 Proposed fix for the syntax error
-    permissions: ["read("any")"], // optional
+    permissions: ['read("any")'], // optional
docs/examples/account/update-phone.md (1)

10-15: ⚠️ Potential issue | 🔴 Critical

Wrap top-level await in async function—code will not execute as written.

The await keyword on line 10 requires an async function context. This example uses await without wrapping, which will throw a syntax error. Out of 108 documentation examples (89% of all examples), this pattern is applied consistently without async context or explanation.

🔧 Proposed fix
 const account = new Account(client);
 
-const result = await account.updatePhone({
-    phone: '+12065550100',
-    password: 'password'
-});
-
-console.log(result);
+(async () => {
+    const result = await account.updatePhone({
+        phone: '+12065550100',
+        password: 'password'
+    });
+
+    console.log(result);
+})();

Alternatively, revert to promise chains (.then()) which don't require async context and are already shown in the README examples.

docs/examples/storage/update-file.md (1)

10-15: ⚠️ Potential issue | 🟠 Major

Fix invalid permissions string literal (syntax error).

["read("any")"] is invalid JavaScript and will break the example. Use the imported Permission and Role helpers instead.

✅ Proposed fix
-    permissions: ["read("any")"] // optional
+    permissions: [Permission.read(Role.any())] // optional
🧹 Nitpick comments (5)
docs/examples/messaging/delete-subscriber.md (1)

2-16: Clear example with proper formatting.

The code example clearly demonstrates the deleteSubscriber API usage with all required parameters. The closing code fence completes the proper Markdown formatting.

Optional: Consider adding async context note.

The example uses await without showing the async function wrapper. While this is common in SDK documentation, you might consider adding a brief note or wrapping the example in an async function to make it immediately runnable:

💡 Optional enhancement for clarity
 ```javascript
 import { Client, Messaging } from "react-native-appwrite";
 
 const client = new Client()
     .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
     .setProject('<YOUR_PROJECT_ID>'); // Your project ID
 
 const messaging = new Messaging(client);
 
-const result = await messaging.deleteSubscriber({
-    topicId: '<TOPIC_ID>',
-    subscriberId: '<SUBSCRIBER_ID>'
-});
-
-console.log(result);
+async function deleteSubscriber() {
+    const result = await messaging.deleteSubscriber({
+        topicId: '<TOPIC_ID>',
+        subscriberId: '<SUBSCRIBER_ID>'
+    });
+    
+    console.log(result);
+}
 ```
docs/examples/account/create-email-token.md (1)

2-16: Consider showing async context and error handling.

The example uses await but doesn't show it within an async function, which might confuse developers copying the code. Additionally, demonstrating error handling would make this a more complete example.

📚 Suggested enhancement for the example
 import { Client, Account } from "react-native-appwrite";
 
-const client = new Client()
-    .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
-    .setProject('<YOUR_PROJECT_ID>'); // Your project ID
-
-const account = new Account(client);
-
-const result = await account.createEmailToken({
-    userId: '<USER_ID>',
-    email: 'email@example.com',
-    phrase: false // optional
-});
-
-console.log(result);
+const createToken = async () => {
+    const client = new Client()
+        .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
+        .setProject('<YOUR_PROJECT_ID>'); // Your project ID
+    
+    const account = new Account(client);
+    
+    try {
+        const result = await account.createEmailToken({
+            userId: '<USER_ID>',
+            email: 'email@example.com',
+            phrase: false // optional
+        });
+        
+        console.log(result);
+    } catch (error) {
+        console.error('Error creating email token:', error);
+    }
+};
+
+createToken();
docs/examples/account/list-mfa-factors.md (1)

10-10: Consider clarifying the async context.

The example uses await at the top level. In React Native, developers would typically need to wrap this in an async function. Consider adding a brief note or wrapping the example in an async function to make it immediately runnable.

📝 Example with async function wrapper
 ```javascript
 import { Client, Account } from "react-native-appwrite";
 
 const client = new Client()
     .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
     .setProject('<YOUR_PROJECT_ID>'); // Your project ID
 
 const account = new Account(client);
 
-const result = await account.listMFAFactors();
-
-console.log(result);
+const listFactors = async () => {
+    const result = await account.listMFAFactors();
+    console.log(result);
+};
+
+listFactors();
 ```
docs/examples/tablesdb/decrement-row-column.md (1)

14-15: Consider improving example values for better clarity.

The example uses an empty string for column and 0 for value, which are not meaningful for demonstrating the decrement functionality. Consider using more realistic placeholder values:

  • column: '<COLUMN_NAME>' or column: 'count'
  • value: 1 (or any non-zero integer)

This would make the example more helpful for developers learning the API.

docs/examples/account/create-email-verification.md (1)

1-15: Consider adding async context to the example.

The example uses await (line 10) without showing the surrounding async function or indicating that top-level await is required. Developers copying this code directly will encounter a syntax error.

💡 Suggested enhancement for clarity

Wrap the example in an async function or add a comment indicating the async context:

 ```javascript
 import { Client, Account } from "react-native-appwrite";
 
+async function createEmailVerification() {
 const client = new Client()
     .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
     .setProject('<YOUR_PROJECT_ID>'); // Your project ID
 
 const account = new Account(client);
 
 const result = await account.createEmailVerification({
     url: 'https://example.com'
 });
 
 console.log(result);
+}

Alternatively, add a note that the code assumes an async context.

</details>

**Note:** This comment applies to all documentation examples in this PR that use `await` without visible async wrapping.

</blockquote></details>

</blockquote></details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

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.

2 participants