diff --git a/README.md b/README.md
index f878dfd..4538da3 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# Appwrite Web SDK

-
+
[](https://travis-ci.com/appwrite/sdk-generator)
[](https://twitter.com/appwrite)
[](https://appwrite.io/discord)
-**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-web/releases).**
+**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-web/releases).**
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 Web 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)
@@ -33,18 +33,20 @@ import { Client, Account } from "appwrite";
To install with a CDN (content delivery network) add the following scripts to the bottom of your
tag, but before you use any Appwrite services:
```html
-
+
```
## Getting Started
### Add your Web Platform
+
For you to init your SDK and interact with Appwrite services you need to add a web platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before and click the 'Add Platform' button.
From the options, choose to add a **Web** platform and add your client app hostname. By adding your hostname to your project platform you are allowing cross-domain communication between your project and the Appwrite API.
### Init your SDK
+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
```js
@@ -58,6 +60,7 @@ client
```
### Make Your First Request
+
Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
```js
@@ -74,6 +77,7 @@ account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien")
```
### Full Example
+
```js
// Init your Web SDK
const client = new Client();
@@ -94,7 +98,83 @@ account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien")
});
```
+### Type Safety with Models
+
+The Appwrite Web SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a generic type parameter that allows you to specify your custom model type for full type safety.
+
+**TypeScript:**
+```typescript
+interface Book {
+ name: string;
+ author: string;
+ releaseYear?: string;
+ category?: string;
+ genre?: string[];
+ isCheckedOut: boolean;
+}
+
+const databases = new Databases(client);
+
+try {
+ const documents = await databases.listDocuments(
+ 'your-database-id',
+ 'your-collection-id'
+ );
+
+ documents.documents.forEach(book => {
+ console.log(`Book: ${book.name} by ${book.author}`); // Now you have full type safety
+ });
+} catch (error) {
+ console.error('Appwrite error:', error);
+}
+```
+
+**JavaScript (with JSDoc for type hints):**
+```javascript
+/**
+ * @typedef {Object} Book
+ * @property {string} name
+ * @property {string} author
+ * @property {string} [releaseYear]
+ * @property {string} [category]
+ * @property {string[]} [genre]
+ * @property {boolean} isCheckedOut
+ */
+
+const databases = new Databases(client);
+
+try {
+ /** @type {Models.DocumentList} */
+ const documents = await databases.listDocuments(
+ 'your-database-id',
+ 'your-collection-id'
+ );
+
+ documents.documents.forEach(book => {
+ console.log(`Book: ${book.name} by ${book.author}`); // Type hints available in IDE
+ });
+} catch (error) {
+ console.error('Appwrite error:', error);
+}
+```
+
+**Tip**: You can use the `appwrite types` command to automatically generate TypeScript interfaces based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation).
+
+### Error Handling
+
+The Appwrite Web SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching the exception and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
+
+```javascript
+try {
+ const user = await account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien");
+ console.log('User created:', user);
+} catch (error) {
+ console.error('Appwrite error:', error.message);
+}
+```
+
### Learn more
+
You can use the following resources to learn more and get help
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-web)
- 📜 [Appwrite Docs](https://appwrite.io/docs)
diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md
index 3438ffb..26a745a 100644
--- a/docs/examples/account/create-email-password-session.md
+++ b/docs/examples/account/create-email-password-session.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createEmailPasswordSession(
- 'email@example.com', // email
- 'password' // password
-);
+const result = await account.createEmailPasswordSession({
+ email: 'email@example.com',
+ password: 'password'
+});
console.log(result);
diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md
index e7cab7c..e0c4cda 100644
--- a/docs/examples/account/create-email-token.md
+++ b/docs/examples/account/create-email-token.md
@@ -6,10 +6,10 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createEmailToken(
- '', // userId
- 'email@example.com', // email
- false // phrase (optional)
-);
+const result = await account.createEmailToken({
+ userId: '',
+ email: 'email@example.com',
+ phrase: false // optional
+});
console.log(result);
diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-jwt.md
similarity index 100%
rename from docs/examples/account/create-j-w-t.md
rename to docs/examples/account/create-jwt.md
diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-url-token.md
similarity index 58%
rename from docs/examples/account/create-magic-u-r-l-token.md
rename to docs/examples/account/create-magic-url-token.md
index ba87bd9..16d3567 100644
--- a/docs/examples/account/create-magic-u-r-l-token.md
+++ b/docs/examples/account/create-magic-url-token.md
@@ -6,11 +6,11 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createMagicURLToken(
- '', // userId
- 'email@example.com', // email
- 'https://example.com', // url (optional)
- false // phrase (optional)
-);
+const result = await account.createMagicURLToken({
+ userId: '',
+ email: 'email@example.com',
+ url: 'https://example.com', // optional
+ phrase: false // optional
+});
console.log(result);
diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md
index 5104815..154be4e 100644
--- a/docs/examples/account/create-mfa-authenticator.md
+++ b/docs/examples/account/create-mfa-authenticator.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createMfaAuthenticator(
- AuthenticatorType.Totp // type
-);
+const result = await account.createMFAAuthenticator({
+ type: AuthenticatorType.Totp
+});
console.log(result);
diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md
index e9f6f08..1328305 100644
--- a/docs/examples/account/create-mfa-challenge.md
+++ b/docs/examples/account/create-mfa-challenge.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createMfaChallenge(
- AuthenticationFactor.Email // factor
-);
+const result = await account.createMFAChallenge({
+ factor: AuthenticationFactor.Email
+});
console.log(result);
diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md
index 2cc7441..d9041f2 100644
--- a/docs/examples/account/create-mfa-recovery-codes.md
+++ b/docs/examples/account/create-mfa-recovery-codes.md
@@ -6,6 +6,6 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createMfaRecoveryCodes();
+const result = await account.createMFARecoveryCodes();
console.log(result);
diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth-2-session.md
similarity index 57%
rename from docs/examples/account/create-o-auth2token.md
rename to docs/examples/account/create-o-auth-2-session.md
index 5f0aab3..b451e25 100644
--- a/docs/examples/account/create-o-auth2token.md
+++ b/docs/examples/account/create-o-auth-2-session.md
@@ -6,10 +6,10 @@ const client = new Client()
const account = new Account(client);
-account.createOAuth2Token(
- OAuthProvider.Amazon, // provider
- 'https://example.com', // success (optional)
- 'https://example.com', // failure (optional)
- [] // scopes (optional)
-);
+account.createOAuth2Session({
+ provider: OAuthProvider.Amazon,
+ success: 'https://example.com', // optional
+ failure: 'https://example.com', // optional
+ scopes: [] // optional
+});
diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth-2-token.md
similarity index 57%
rename from docs/examples/account/create-o-auth2session.md
rename to docs/examples/account/create-o-auth-2-token.md
index caad309..0fce114 100644
--- a/docs/examples/account/create-o-auth2session.md
+++ b/docs/examples/account/create-o-auth-2-token.md
@@ -6,10 +6,10 @@ const client = new Client()
const account = new Account(client);
-account.createOAuth2Session(
- OAuthProvider.Amazon, // provider
- 'https://example.com', // success (optional)
- 'https://example.com', // failure (optional)
- [] // scopes (optional)
-);
+account.createOAuth2Token({
+ provider: OAuthProvider.Amazon,
+ success: 'https://example.com', // optional
+ failure: 'https://example.com', // optional
+ scopes: [] // optional
+});
diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md
index 481e57d..60d032e 100644
--- a/docs/examples/account/create-phone-token.md
+++ b/docs/examples/account/create-phone-token.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createPhoneToken(
- '', // userId
- '+12065550100' // phone
-);
+const result = await account.createPhoneToken({
+ userId: '',
+ phone: '+12065550100'
+});
console.log(result);
diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md
index c987e3d..1f973e1 100644
--- a/docs/examples/account/create-push-target.md
+++ b/docs/examples/account/create-push-target.md
@@ -6,10 +6,10 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createPushTarget(
- '', // targetId
- '', // identifier
- '' // providerId (optional)
-);
+const result = await account.createPushTarget({
+ targetId: '',
+ identifier: '',
+ providerId: '' // optional
+});
console.log(result);
diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md
index f0a400d..2195ed9 100644
--- a/docs/examples/account/create-recovery.md
+++ b/docs/examples/account/create-recovery.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createRecovery(
- 'email@example.com', // email
- 'https://example.com' // url
-);
+const result = await account.createRecovery({
+ email: 'email@example.com',
+ url: 'https://example.com'
+});
console.log(result);
diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md
index b6d7ef8..4858f9f 100644
--- a/docs/examples/account/create-session.md
+++ b/docs/examples/account/create-session.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createSession(
- '', // userId
- '' // secret
-);
+const result = await account.createSession({
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md
index 4a3b314..0325e40 100644
--- a/docs/examples/account/create-verification.md
+++ b/docs/examples/account/create-verification.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.createVerification(
- 'https://example.com' // url
-);
+const result = await account.createVerification({
+ url: 'https://example.com'
+});
console.log(result);
diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md
index bf2dbec..dbb374d 100644
--- a/docs/examples/account/create.md
+++ b/docs/examples/account/create.md
@@ -6,11 +6,11 @@ const client = new Client()
const account = new Account(client);
-const result = await account.create(
- '', // userId
- 'email@example.com', // email
- '', // password
- '' // name (optional)
-);
+const result = await account.create({
+ userId: '',
+ email: 'email@example.com',
+ password: '',
+ name: '' // optional
+});
console.log(result);
diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md
index f34baaa..4843449 100644
--- a/docs/examples/account/delete-identity.md
+++ b/docs/examples/account/delete-identity.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.deleteIdentity(
- '' // identityId
-);
+const result = await account.deleteIdentity({
+ identityId: ''
+});
console.log(result);
diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md
index d113514..2b1a878 100644
--- a/docs/examples/account/delete-mfa-authenticator.md
+++ b/docs/examples/account/delete-mfa-authenticator.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.deleteMfaAuthenticator(
- AuthenticatorType.Totp // type
-);
+const result = await account.deleteMFAAuthenticator({
+ type: AuthenticatorType.Totp
+});
console.log(result);
diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md
index 79bb06e..1a09b32 100644
--- a/docs/examples/account/delete-push-target.md
+++ b/docs/examples/account/delete-push-target.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.deletePushTarget(
- '' // targetId
-);
+const result = await account.deletePushTarget({
+ targetId: ''
+});
console.log(result);
diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md
index 4d27221..bf17ffc 100644
--- a/docs/examples/account/delete-session.md
+++ b/docs/examples/account/delete-session.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.deleteSession(
- '' // sessionId
-);
+const result = await account.deleteSession({
+ sessionId: ''
+});
console.log(result);
diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md
index 850488b..527ebd9 100644
--- a/docs/examples/account/get-mfa-recovery-codes.md
+++ b/docs/examples/account/get-mfa-recovery-codes.md
@@ -6,6 +6,6 @@ const client = new Client()
const account = new Account(client);
-const result = await account.getMfaRecoveryCodes();
+const result = await account.getMFARecoveryCodes();
console.log(result);
diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md
index 29af110..8c4bdd7 100644
--- a/docs/examples/account/get-session.md
+++ b/docs/examples/account/get-session.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.getSession(
- '' // sessionId
-);
+const result = await account.getSession({
+ sessionId: ''
+});
console.log(result);
diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md
index 54c569b..28cc409 100644
--- a/docs/examples/account/list-identities.md
+++ b/docs/examples/account/list-identities.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.listIdentities(
- [] // queries (optional)
-);
+const result = await account.listIdentities({
+ queries: [] // optional
+});
console.log(result);
diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md
index 17c214f..ec763f9 100644
--- a/docs/examples/account/list-logs.md
+++ b/docs/examples/account/list-logs.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.listLogs(
- [] // queries (optional)
-);
+const result = await account.listLogs({
+ queries: [] // optional
+});
console.log(result);
diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md
index c9fa7da..80151d9 100644
--- a/docs/examples/account/list-mfa-factors.md
+++ b/docs/examples/account/list-mfa-factors.md
@@ -6,6 +6,6 @@ const client = new Client()
const account = new Account(client);
-const result = await account.listMfaFactors();
+const result = await account.listMFAFactors();
console.log(result);
diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md
index 9e02fc9..96dcec5 100644
--- a/docs/examples/account/update-email.md
+++ b/docs/examples/account/update-email.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateEmail(
- 'email@example.com', // email
- 'password' // password
-);
+const result = await account.updateEmail({
+ email: 'email@example.com',
+ password: 'password'
+});
console.log(result);
diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-url-session.md
similarity index 71%
rename from docs/examples/account/update-magic-u-r-l-session.md
rename to docs/examples/account/update-magic-url-session.md
index 47501c5..c126f7c 100644
--- a/docs/examples/account/update-magic-u-r-l-session.md
+++ b/docs/examples/account/update-magic-url-session.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateMagicURLSession(
- '', // userId
- '' // secret
-);
+const result = await account.updateMagicURLSession({
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md
index 74eedd8..f5ce65e 100644
--- a/docs/examples/account/update-mfa-authenticator.md
+++ b/docs/examples/account/update-mfa-authenticator.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateMfaAuthenticator(
- AuthenticatorType.Totp, // type
- '' // otp
-);
+const result = await account.updateMFAAuthenticator({
+ type: AuthenticatorType.Totp,
+ otp: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md
index 01a09dd..016533c 100644
--- a/docs/examples/account/update-mfa-challenge.md
+++ b/docs/examples/account/update-mfa-challenge.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateMfaChallenge(
- '', // challengeId
- '' // otp
-);
+const result = await account.updateMFAChallenge({
+ challengeId: '',
+ otp: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md
index 24ff10b..3ab0385 100644
--- a/docs/examples/account/update-mfa-recovery-codes.md
+++ b/docs/examples/account/update-mfa-recovery-codes.md
@@ -6,6 +6,6 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateMfaRecoveryCodes();
+const result = await account.updateMFARecoveryCodes();
console.log(result);
diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-mfa.md
similarity index 81%
rename from docs/examples/account/update-m-f-a.md
rename to docs/examples/account/update-mfa.md
index 58b6a06..4d20604 100644
--- a/docs/examples/account/update-m-f-a.md
+++ b/docs/examples/account/update-mfa.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateMFA(
- false // mfa
-);
+const result = await account.updateMFA({
+ mfa: false
+});
console.log(result);
diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md
index d6a6946..6a9ba82 100644
--- a/docs/examples/account/update-name.md
+++ b/docs/examples/account/update-name.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateName(
- '' // name
-);
+const result = await account.updateName({
+ name: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md
index 575779e..743335b 100644
--- a/docs/examples/account/update-password.md
+++ b/docs/examples/account/update-password.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePassword(
- '', // password
- 'password' // oldPassword (optional)
-);
+const result = await account.updatePassword({
+ password: '',
+ oldPassword: 'password' // optional
+});
console.log(result);
diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md
index 092205e..39d0d36 100644
--- a/docs/examples/account/update-phone-session.md
+++ b/docs/examples/account/update-phone-session.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePhoneSession(
- '', // userId
- '' // secret
-);
+const result = await account.updatePhoneSession({
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md
index 1b85178..6be1b77 100644
--- a/docs/examples/account/update-phone-verification.md
+++ b/docs/examples/account/update-phone-verification.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePhoneVerification(
- '', // userId
- '' // secret
-);
+const result = await account.updatePhoneVerification({
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md
index 0c5ff21..912b2e5 100644
--- a/docs/examples/account/update-phone.md
+++ b/docs/examples/account/update-phone.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePhone(
- '+12065550100', // phone
- 'password' // password
-);
+const result = await account.updatePhone({
+ phone: '+12065550100',
+ password: 'password'
+});
console.log(result);
diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md
index b9e88ea..98ea841 100644
--- a/docs/examples/account/update-prefs.md
+++ b/docs/examples/account/update-prefs.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePrefs(
- {} // prefs
-);
+const result = await account.updatePrefs({
+ prefs: {}
+});
console.log(result);
diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md
index 3475a22..57fdd6b 100644
--- a/docs/examples/account/update-push-target.md
+++ b/docs/examples/account/update-push-target.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updatePushTarget(
- '', // targetId
- '' // identifier
-);
+const result = await account.updatePushTarget({
+ targetId: '',
+ identifier: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md
index 328e50e..d975647 100644
--- a/docs/examples/account/update-recovery.md
+++ b/docs/examples/account/update-recovery.md
@@ -6,10 +6,10 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateRecovery(
- '', // userId
- '', // secret
- '' // password
-);
+const result = await account.updateRecovery({
+ userId: '',
+ secret: '',
+ password: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md
index 4ccc829..4c9890b 100644
--- a/docs/examples/account/update-session.md
+++ b/docs/examples/account/update-session.md
@@ -6,8 +6,8 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateSession(
- '' // sessionId
-);
+const result = await account.updateSession({
+ sessionId: ''
+});
console.log(result);
diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md
index 6d15aee..b5fea5c 100644
--- a/docs/examples/account/update-verification.md
+++ b/docs/examples/account/update-verification.md
@@ -6,9 +6,9 @@ const client = new Client()
const account = new Account(client);
-const result = await account.updateVerification(
- '', // userId
- '' // secret
-);
+const result = await account.updateVerification({
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md
index 08512d1..a0deff3 100644
--- a/docs/examples/avatars/get-browser.md
+++ b/docs/examples/avatars/get-browser.md
@@ -6,11 +6,11 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getBrowser(
- Browser.AvantBrowser, // code
- 0, // width (optional)
- 0, // height (optional)
- -1 // quality (optional)
-);
+const result = avatars.getBrowser({
+ code: Browser.AvantBrowser,
+ width: 0, // optional
+ height: 0, // optional
+ quality: -1 // optional
+});
console.log(result);
diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md
index fb631a4..af0599a 100644
--- a/docs/examples/avatars/get-credit-card.md
+++ b/docs/examples/avatars/get-credit-card.md
@@ -6,11 +6,11 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getCreditCard(
- CreditCard.AmericanExpress, // code
- 0, // width (optional)
- 0, // height (optional)
- -1 // quality (optional)
-);
+const result = avatars.getCreditCard({
+ code: CreditCard.AmericanExpress,
+ width: 0, // optional
+ height: 0, // optional
+ quality: -1 // optional
+});
console.log(result);
diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md
index 85317f1..2e976c6 100644
--- a/docs/examples/avatars/get-favicon.md
+++ b/docs/examples/avatars/get-favicon.md
@@ -6,8 +6,8 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getFavicon(
- 'https://example.com' // url
-);
+const result = avatars.getFavicon({
+ url: 'https://example.com'
+});
console.log(result);
diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md
index bfbc6c2..76e7733 100644
--- a/docs/examples/avatars/get-flag.md
+++ b/docs/examples/avatars/get-flag.md
@@ -6,11 +6,11 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getFlag(
- Flag.Afghanistan, // code
- 0, // width (optional)
- 0, // height (optional)
- -1 // quality (optional)
-);
+const result = avatars.getFlag({
+ code: Flag.Afghanistan,
+ width: 0, // optional
+ height: 0, // optional
+ quality: -1 // optional
+});
console.log(result);
diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md
index 36f88ec..b8fe0f0 100644
--- a/docs/examples/avatars/get-image.md
+++ b/docs/examples/avatars/get-image.md
@@ -6,10 +6,10 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getImage(
- 'https://example.com', // url
- 0, // width (optional)
- 0 // height (optional)
-);
+const result = avatars.getImage({
+ url: 'https://example.com',
+ width: 0, // optional
+ height: 0 // optional
+});
console.log(result);
diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md
index 321c448..01c1830 100644
--- a/docs/examples/avatars/get-initials.md
+++ b/docs/examples/avatars/get-initials.md
@@ -6,11 +6,11 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getInitials(
- '', // name (optional)
- 0, // width (optional)
- 0, // height (optional)
- '' // background (optional)
-);
+const result = avatars.getInitials({
+ name: '', // optional
+ width: 0, // optional
+ height: 0, // optional
+ background: '' // optional
+});
console.log(result);
diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-qr.md
similarity index 65%
rename from docs/examples/avatars/get-q-r.md
rename to docs/examples/avatars/get-qr.md
index cbbabbc..53202d8 100644
--- a/docs/examples/avatars/get-q-r.md
+++ b/docs/examples/avatars/get-qr.md
@@ -6,11 +6,11 @@ const client = new Client()
const avatars = new Avatars(client);
-const result = avatars.getQR(
- '', // text
- 1, // size (optional)
- 0, // margin (optional)
- false // download (optional)
-);
+const result = avatars.getQR({
+ text: '',
+ size: 1, // optional
+ margin: 0, // optional
+ download: false // optional
+});
console.log(result);
diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md
index 916cc92..5c561ab 100644
--- a/docs/examples/databases/create-document.md
+++ b/docs/examples/databases/create-document.md
@@ -6,12 +6,12 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.createDocument(
- '', // databaseId
- '', // collectionId
- '', // documentId
- {}, // data
- ["read("any")"] // permissions (optional)
-);
+const result = await databases.createDocument({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ data: {},
+ permissions: ["read("any")"] // optional
+});
console.log(result);
diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md
index 10d785a..98629c4 100644
--- a/docs/examples/databases/decrement-document-attribute.md
+++ b/docs/examples/databases/decrement-document-attribute.md
@@ -6,13 +6,13 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.decrementDocumentAttribute(
- '', // databaseId
- '', // collectionId
- '', // documentId
- '', // attribute
- null, // value (optional)
- null // min (optional)
-);
+const result = await databases.decrementDocumentAttribute({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ attribute: '',
+ value: null, // optional
+ min: null // optional
+});
console.log(result);
diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md
index c9a1e9f..4192085 100644
--- a/docs/examples/databases/delete-document.md
+++ b/docs/examples/databases/delete-document.md
@@ -6,10 +6,10 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.deleteDocument(
- '', // databaseId
- '', // collectionId
- '' // documentId
-);
+const result = await databases.deleteDocument({
+ databaseId: '',
+ collectionId: '',
+ documentId: ''
+});
console.log(result);
diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md
index a2836fc..b3a7558 100644
--- a/docs/examples/databases/get-document.md
+++ b/docs/examples/databases/get-document.md
@@ -6,11 +6,11 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.getDocument(
- '', // databaseId
- '', // collectionId
- '', // documentId
- [] // queries (optional)
-);
+const result = await databases.getDocument({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ queries: [] // optional
+});
console.log(result);
diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md
index 4b32be9..8adb5d8 100644
--- a/docs/examples/databases/increment-document-attribute.md
+++ b/docs/examples/databases/increment-document-attribute.md
@@ -6,13 +6,13 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.incrementDocumentAttribute(
- '', // databaseId
- '', // collectionId
- '', // documentId
- '', // attribute
- null, // value (optional)
- null // max (optional)
-);
+const result = await databases.incrementDocumentAttribute({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ attribute: '',
+ value: null, // optional
+ max: null // optional
+});
console.log(result);
diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md
index d00ac56..fb1d508 100644
--- a/docs/examples/databases/list-documents.md
+++ b/docs/examples/databases/list-documents.md
@@ -6,10 +6,10 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.listDocuments(
- '', // databaseId
- '', // collectionId
- [] // queries (optional)
-);
+const result = await databases.listDocuments({
+ databaseId: '',
+ collectionId: '',
+ queries: [] // optional
+});
console.log(result);
diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md
index c0e06fc..bf35548 100644
--- a/docs/examples/databases/update-document.md
+++ b/docs/examples/databases/update-document.md
@@ -6,12 +6,12 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.updateDocument(
- '', // databaseId
- '', // collectionId
- '', // documentId
- {}, // data (optional)
- ["read("any")"] // permissions (optional)
-);
+const result = await databases.updateDocument({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ data: {}, // optional
+ permissions: ["read("any")"] // optional
+});
console.log(result);
diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md
index cfefe06..c56bc55 100644
--- a/docs/examples/databases/upsert-document.md
+++ b/docs/examples/databases/upsert-document.md
@@ -6,12 +6,12 @@ const client = new Client()
const databases = new Databases(client);
-const result = await databases.upsertDocument(
- '', // databaseId
- '', // collectionId
- '', // documentId
- {}, // data
- ["read("any")"] // permissions (optional)
-);
+const result = await databases.upsertDocument({
+ databaseId: '',
+ collectionId: '',
+ documentId: '',
+ data: {},
+ permissions: ["read("any")"] // optional
+});
console.log(result);
diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md
index 8f07523..b8c955b 100644
--- a/docs/examples/functions/create-execution.md
+++ b/docs/examples/functions/create-execution.md
@@ -6,14 +6,14 @@ const client = new Client()
const functions = new Functions(client);
-const result = await functions.createExecution(
- '', // functionId
- '', // body (optional)
- false, // async (optional)
- '', // path (optional)
- ExecutionMethod.GET, // method (optional)
- {}, // headers (optional)
- '' // scheduledAt (optional)
-);
+const result = await functions.createExecution({
+ functionId: '',
+ body: '', // optional
+ async: false, // optional
+ path: '', // optional
+ method: ExecutionMethod.GET, // optional
+ headers: {}, // optional
+ scheduledAt: '' // optional
+});
console.log(result);
diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md
index 9b88f81..1e9a367 100644
--- a/docs/examples/functions/get-execution.md
+++ b/docs/examples/functions/get-execution.md
@@ -6,9 +6,9 @@ const client = new Client()
const functions = new Functions(client);
-const result = await functions.getExecution(
- '', // functionId
- '' // executionId
-);
+const result = await functions.getExecution({
+ functionId: '',
+ executionId: ''
+});
console.log(result);
diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md
index 9ec5063..159882c 100644
--- a/docs/examples/functions/list-executions.md
+++ b/docs/examples/functions/list-executions.md
@@ -6,9 +6,9 @@ const client = new Client()
const functions = new Functions(client);
-const result = await functions.listExecutions(
- '', // functionId
- [] // queries (optional)
-);
+const result = await functions.listExecutions({
+ functionId: '',
+ queries: [] // optional
+});
console.log(result);
diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md
index 0e7466a..5771af0 100644
--- a/docs/examples/graphql/mutation.md
+++ b/docs/examples/graphql/mutation.md
@@ -6,8 +6,8 @@ const client = new Client()
const graphql = new Graphql(client);
-const result = await graphql.mutation(
- {} // query
-);
+const result = await graphql.mutation({
+ query: {}
+});
console.log(result);
diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md
index f9cd9b7..c367d07 100644
--- a/docs/examples/graphql/query.md
+++ b/docs/examples/graphql/query.md
@@ -6,8 +6,8 @@ const client = new Client()
const graphql = new Graphql(client);
-const result = await graphql.query(
- {} // query
-);
+const result = await graphql.query({
+ query: {}
+});
console.log(result);
diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-eu.md
similarity index 100%
rename from docs/examples/locale/list-countries-e-u.md
rename to docs/examples/locale/list-countries-eu.md
diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md
index 2548709..59b7603 100644
--- a/docs/examples/messaging/create-subscriber.md
+++ b/docs/examples/messaging/create-subscriber.md
@@ -6,10 +6,10 @@ const client = new Client()
const messaging = new Messaging(client);
-const result = await messaging.createSubscriber(
- '', // topicId
- '', // subscriberId
- '' // targetId
-);
+const result = await messaging.createSubscriber({
+ topicId: '',
+ subscriberId: '',
+ targetId: ''
+});
console.log(result);
diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md
index 3d5d0a4..dfe2d06 100644
--- a/docs/examples/messaging/delete-subscriber.md
+++ b/docs/examples/messaging/delete-subscriber.md
@@ -6,9 +6,9 @@ const client = new Client()
const messaging = new Messaging(client);
-const result = await messaging.deleteSubscriber(
- '', // topicId
- '' // subscriberId
-);
+const result = await messaging.deleteSubscriber({
+ topicId: '',
+ subscriberId: ''
+});
console.log(result);
diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md
index 20a4220..999fcb2 100644
--- a/docs/examples/storage/create-file.md
+++ b/docs/examples/storage/create-file.md
@@ -6,11 +6,11 @@ const client = new Client()
const storage = new Storage(client);
-const result = await storage.createFile(
- '', // bucketId
- '', // fileId
- document.getElementById('uploader').files[0], // file
- ["read("any")"] // permissions (optional)
-);
+const result = await storage.createFile({
+ bucketId: '',
+ fileId: '',
+ file: document.getElementById('uploader').files[0],
+ permissions: ["read("any")"] // optional
+});
console.log(result);
diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md
index 373cdc0..101b878 100644
--- a/docs/examples/storage/delete-file.md
+++ b/docs/examples/storage/delete-file.md
@@ -6,9 +6,9 @@ const client = new Client()
const storage = new Storage(client);
-const result = await storage.deleteFile(
- '', // bucketId
- '' // fileId
-);
+const result = await storage.deleteFile({
+ bucketId: '',
+ fileId: ''
+});
console.log(result);
diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md
index 3ebb8f8..8454be4 100644
--- a/docs/examples/storage/get-file-download.md
+++ b/docs/examples/storage/get-file-download.md
@@ -6,10 +6,10 @@ const client = new Client()
const storage = new Storage(client);
-const result = storage.getFileDownload(
- '', // bucketId
- '', // fileId
- '' // token (optional)
-);
+const result = storage.getFileDownload({
+ bucketId: '',
+ fileId: '',
+ token: '' // optional
+});
console.log(result);
diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md
index ffc64c9..c4e855b 100644
--- a/docs/examples/storage/get-file-preview.md
+++ b/docs/examples/storage/get-file-preview.md
@@ -6,21 +6,21 @@ const client = new Client()
const storage = new Storage(client);
-const result = storage.getFilePreview(
- '', // bucketId
- '', // fileId
- 0, // width (optional)
- 0, // height (optional)
- ImageGravity.Center, // gravity (optional)
- -1, // quality (optional)
- 0, // borderWidth (optional)
- '', // borderColor (optional)
- 0, // borderRadius (optional)
- 0, // opacity (optional)
- -360, // rotation (optional)
- '', // background (optional)
- ImageFormat.Jpg, // output (optional)
- '' // token (optional)
-);
+const result = storage.getFilePreview({
+ bucketId: '',
+ fileId: '',
+ width: 0, // optional
+ height: 0, // optional
+ gravity: ImageGravity.Center, // optional
+ quality: -1, // optional
+ borderWidth: 0, // optional
+ borderColor: '', // optional
+ borderRadius: 0, // optional
+ opacity: 0, // optional
+ rotation: -360, // optional
+ background: '', // optional
+ output: ImageFormat.Jpg, // optional
+ token: '' // optional
+});
console.log(result);
diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md
index add5a6f..edc28f1 100644
--- a/docs/examples/storage/get-file-view.md
+++ b/docs/examples/storage/get-file-view.md
@@ -6,10 +6,10 @@ const client = new Client()
const storage = new Storage(client);
-const result = storage.getFileView(
- '', // bucketId
- '', // fileId
- '' // token (optional)
-);
+const result = storage.getFileView({
+ bucketId: '',
+ fileId: '',
+ token: '' // optional
+});
console.log(result);
diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md
index 10bd9fb..41c41b6 100644
--- a/docs/examples/storage/get-file.md
+++ b/docs/examples/storage/get-file.md
@@ -6,9 +6,9 @@ const client = new Client()
const storage = new Storage(client);
-const result = await storage.getFile(
- '', // bucketId
- '' // fileId
-);
+const result = await storage.getFile({
+ bucketId: '',
+ fileId: ''
+});
console.log(result);
diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md
index f2c3ccb..154212d 100644
--- a/docs/examples/storage/list-files.md
+++ b/docs/examples/storage/list-files.md
@@ -6,10 +6,10 @@ const client = new Client()
const storage = new Storage(client);
-const result = await storage.listFiles(
- '', // bucketId
- [], // queries (optional)
- '' // search (optional)
-);
+const result = await storage.listFiles({
+ bucketId: '',
+ queries: [], // optional
+ search: '' // optional
+});
console.log(result);
diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md
index 1432b85..96e1dc5 100644
--- a/docs/examples/storage/update-file.md
+++ b/docs/examples/storage/update-file.md
@@ -6,11 +6,11 @@ const client = new Client()
const storage = new Storage(client);
-const result = await storage.updateFile(
- '', // bucketId
- '', // fileId
- '', // name (optional)
- ["read("any")"] // permissions (optional)
-);
+const result = await storage.updateFile({
+ bucketId: '',
+ fileId: '',
+ name: '', // optional
+ permissions: ["read("any")"] // optional
+});
console.log(result);
diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md
new file mode 100644
index 0000000..aafe71f
--- /dev/null
+++ b/docs/examples/tablesdb/create-row.md
@@ -0,0 +1,17 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.createRow({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ data: {},
+ permissions: ["read("any")"] // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md
new file mode 100644
index 0000000..59f66d9
--- /dev/null
+++ b/docs/examples/tablesdb/decrement-row-column.md
@@ -0,0 +1,18 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.decrementRowColumn({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ column: '',
+ value: null, // optional
+ min: null // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md
new file mode 100644
index 0000000..637114d
--- /dev/null
+++ b/docs/examples/tablesdb/delete-row.md
@@ -0,0 +1,15 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.deleteRow({
+ databaseId: '',
+ tableId: '',
+ rowId: ''
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md
new file mode 100644
index 0000000..4e43643
--- /dev/null
+++ b/docs/examples/tablesdb/get-row.md
@@ -0,0 +1,16 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.getRow({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ queries: [] // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md
new file mode 100644
index 0000000..a7f3a8c
--- /dev/null
+++ b/docs/examples/tablesdb/increment-row-column.md
@@ -0,0 +1,18 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.incrementRowColumn({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ column: '',
+ value: null, // optional
+ max: null // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md
new file mode 100644
index 0000000..63149aa
--- /dev/null
+++ b/docs/examples/tablesdb/list-rows.md
@@ -0,0 +1,15 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.listRows({
+ databaseId: '',
+ tableId: '',
+ queries: [] // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md
new file mode 100644
index 0000000..1dba006
--- /dev/null
+++ b/docs/examples/tablesdb/update-row.md
@@ -0,0 +1,17 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.updateRow({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ data: {}, // optional
+ permissions: ["read("any")"] // optional
+});
+
+console.log(result);
diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md
new file mode 100644
index 0000000..1add1c4
--- /dev/null
+++ b/docs/examples/tablesdb/upsert-row.md
@@ -0,0 +1,17 @@
+import { Client, TablesDB } from "appwrite";
+
+const client = new Client()
+ .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint
+ .setProject(''); // Your project ID
+
+const tablesDB = new TablesDB(client);
+
+const result = await tablesDB.upsertRow({
+ databaseId: '',
+ tableId: '',
+ rowId: '',
+ data: {}, // optional
+ permissions: ["read("any")"] // optional
+});
+
+console.log(result);
diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md
index 8802e25..c72da99 100644
--- a/docs/examples/teams/create-membership.md
+++ b/docs/examples/teams/create-membership.md
@@ -6,14 +6,14 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.createMembership(
- '', // teamId
- [], // roles
- 'email@example.com', // email (optional)
- '', // userId (optional)
- '+12065550100', // phone (optional)
- 'https://example.com', // url (optional)
- '' // name (optional)
-);
+const result = await teams.createMembership({
+ teamId: '',
+ roles: [],
+ email: 'email@example.com', // optional
+ userId: '', // optional
+ phone: '+12065550100', // optional
+ url: 'https://example.com', // optional
+ name: '' // optional
+});
console.log(result);
diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md
index b23f220..a156156 100644
--- a/docs/examples/teams/create.md
+++ b/docs/examples/teams/create.md
@@ -6,10 +6,10 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.create(
- '', // teamId
- '', // name
- [] // roles (optional)
-);
+const result = await teams.create({
+ teamId: '',
+ name: '',
+ roles: [] // optional
+});
console.log(result);
diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md
index 2f360c3..95e5fde 100644
--- a/docs/examples/teams/delete-membership.md
+++ b/docs/examples/teams/delete-membership.md
@@ -6,9 +6,9 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.deleteMembership(
- '', // teamId
- '' // membershipId
-);
+const result = await teams.deleteMembership({
+ teamId: '',
+ membershipId: ''
+});
console.log(result);
diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md
index 5fd7f5d..7299f0f 100644
--- a/docs/examples/teams/delete.md
+++ b/docs/examples/teams/delete.md
@@ -6,8 +6,8 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.delete(
- '' // teamId
-);
+const result = await teams.delete({
+ teamId: ''
+});
console.log(result);
diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md
index cd253fd..a6d4186 100644
--- a/docs/examples/teams/get-membership.md
+++ b/docs/examples/teams/get-membership.md
@@ -6,9 +6,9 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.getMembership(
- '', // teamId
- '' // membershipId
-);
+const result = await teams.getMembership({
+ teamId: '',
+ membershipId: ''
+});
console.log(result);
diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md
index a7f346f..98c7605 100644
--- a/docs/examples/teams/get-prefs.md
+++ b/docs/examples/teams/get-prefs.md
@@ -6,8 +6,8 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.getPrefs(
- '' // teamId
-);
+const result = await teams.getPrefs({
+ teamId: ''
+});
console.log(result);
diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md
index 539bdcf..c910429 100644
--- a/docs/examples/teams/get.md
+++ b/docs/examples/teams/get.md
@@ -6,8 +6,8 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.get(
- '' // teamId
-);
+const result = await teams.get({
+ teamId: ''
+});
console.log(result);
diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md
index e8cc39b..d4e3420 100644
--- a/docs/examples/teams/list-memberships.md
+++ b/docs/examples/teams/list-memberships.md
@@ -6,10 +6,10 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.listMemberships(
- '', // teamId
- [], // queries (optional)
- '' // search (optional)
-);
+const result = await teams.listMemberships({
+ teamId: '',
+ queries: [], // optional
+ search: '' // optional
+});
console.log(result);
diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md
index 4ca13ce..df57f25 100644
--- a/docs/examples/teams/list.md
+++ b/docs/examples/teams/list.md
@@ -6,9 +6,9 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.list(
- [], // queries (optional)
- '' // search (optional)
-);
+const result = await teams.list({
+ queries: [], // optional
+ search: '' // optional
+});
console.log(result);
diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md
index 89cc13c..8fe6108 100644
--- a/docs/examples/teams/update-membership-status.md
+++ b/docs/examples/teams/update-membership-status.md
@@ -6,11 +6,11 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.updateMembershipStatus(
- '', // teamId
- '', // membershipId
- '', // userId
- '' // secret
-);
+const result = await teams.updateMembershipStatus({
+ teamId: '',
+ membershipId: '',
+ userId: '',
+ secret: ''
+});
console.log(result);
diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md
index fd6ffff..5db27e0 100644
--- a/docs/examples/teams/update-membership.md
+++ b/docs/examples/teams/update-membership.md
@@ -6,10 +6,10 @@ const client = new Client()
const teams = new Teams(client);
-const result = await teams.updateMembership(
- '', // teamId
- '