diff --git a/app/config/platforms.php b/app/config/platforms.php index 06bdf43c8f..f2b7802fde 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -135,6 +135,24 @@ return [ 'Java' => 'java', ], ], + [ + 'key' => 'react-native', + 'name' => 'React Native', + 'version' => '0.3.0', + 'url' => 'https://github.com/appwrite/sdk-for-react-native', + 'package' => 'https://npmjs.com/package/react-native-appwrite', + 'enabled' => true, + 'beta' => true, + 'dev' => false, + 'hidden' => false, + 'family' => APP_PLATFORM_CLIENT, + 'prism' => 'javascript', + 'source' => \realpath(__DIR__ . '/../sdks/client-react-native'), + 'gitUrl' => 'git@github.com:appwrite/sdk-for-react-native.git', + 'gitRepoName' => 'sdk-for-react-native', + 'gitUserName' => 'appwrite', + 'gitBranch' => 'dev', + ], [ 'key' => 'graphql', 'name' => 'GraphQL', diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md new file mode 100644 index 0000000000..1c807bdc96 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-anonymous-session.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createAnonymousSession(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md new file mode 100644 index 0000000000..d338cbe233 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-email-password-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailPasswordSession( + 'email@example.com', // email + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md new file mode 100644 index 0000000000..cb2a31145b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-email-token.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createEmailToken( + '', // userId + 'email@example.com', // email + false // phrase (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md b/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md new file mode 100644 index 0000000000..88ea31c5a3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-j-w-t.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createJWT(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md new file mode 100644 index 0000000000..f2e7e8faf6 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-magic-u-r-l-token.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMagicURLToken( + '', // userId + 'email@example.com', // email + 'https://example.com', // url (optional) + false // phrase (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md new file mode 100644 index 0000000000..88bc313a88 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-authenticator.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaAuthenticator( + AuthenticatorType.Totp // type +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md new file mode 100644 index 0000000000..119a204f0b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-challenge.md @@ -0,0 +1,13 @@ +import { Client, Account, AuthenticationFactor } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaChallenge( + AuthenticationFactor.Email // factor +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md new file mode 100644 index 0000000000..4ffd8a39a1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md new file mode 100644 index 0000000000..2302aaaa1e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2session.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Session( + OAuthProvider.Amazon, // provider + 'https://example.com', // success (optional) + 'https://example.com', // failure (optional) + [] // scopes (optional) +); + diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md new file mode 100644 index 0000000000..3479924e64 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-o-auth2token.md @@ -0,0 +1,15 @@ +import { Client, Account, OAuthProvider } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +account.createOAuth2Token( + OAuthProvider.Amazon, // provider + 'https://example.com', // success (optional) + 'https://example.com', // failure (optional) + [] // scopes (optional) +); + diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md new file mode 100644 index 0000000000..93fc1b7f51 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-token.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneToken( + '', // userId + '+12065550100' // phone +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md new file mode 100644 index 0000000000..28833c1806 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-phone-verification.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPhoneVerification(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md new file mode 100644 index 0000000000..dd15821eaa --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-push-target.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createPushTarget( + '', // targetId + '', // identifier + '' // providerId (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md b/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md new file mode 100644 index 0000000000..5d2855486b --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-recovery.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createRecovery( + 'email@example.com', // email + 'https://example.com' // url +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-session.md b/docs/examples/1.5.x/client-react-native/examples/account/create-session.md new file mode 100644 index 0000000000..f8a9f109a7 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md new file mode 100644 index 0000000000..d072126c4e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create-verification.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.createVerification( + 'https://example.com' // url +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/create.md b/docs/examples/1.5.x/client-react-native/examples/account/create.md new file mode 100644 index 0000000000..300f59b219 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/create.md @@ -0,0 +1,16 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.create( + '', // userId + 'email@example.com', // email + '', // password + '' // name (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md new file mode 100644 index 0000000000..9ff1bbd35d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-identity.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteIdentity( + '' // identityId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md new file mode 100644 index 0000000000..c5f5695ddf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteMfaAuthenticator( + AuthenticatorType.Totp, // type + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md new file mode 100644 index 0000000000..351b933bd0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-push-target.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deletePushTarget( + '' // targetId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md new file mode 100644 index 0000000000..22966495c1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md b/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md new file mode 100644 index 0000000000..b0967bf019 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/delete-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.deleteSessions(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md new file mode 100644 index 0000000000..d1c38fdde0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md b/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md new file mode 100644 index 0000000000..b2502d7b19 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-prefs.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getPrefs(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get-session.md b/docs/examples/1.5.x/client-react-native/examples/account/get-session.md new file mode 100644 index 0000000000..3ecb79feee --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.getSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/get.md b/docs/examples/1.5.x/client-react-native/examples/account/get.md new file mode 100644 index 0000000000..94f0779d53 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/get.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.get(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md b/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md new file mode 100644 index 0000000000..e7ca637afe --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-identities.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listIdentities( + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md b/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md new file mode 100644 index 0000000000..424f8d76af --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listLogs( + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md b/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md new file mode 100644 index 0000000000..c6343a732e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-mfa-factors.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listMfaFactors(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md b/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md new file mode 100644 index 0000000000..b0840c59e3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/list-sessions.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.listSessions(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-email.md b/docs/examples/1.5.x/client-react-native/examples/account/update-email.md new file mode 100644 index 0000000000..560581e63c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-email.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateEmail( + 'email@example.com', // email + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md b/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md new file mode 100644 index 0000000000..38fd716c6a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-m-f-a.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMFA( + false // mfa +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md new file mode 100644 index 0000000000..bb0c000126 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-magic-u-r-l-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMagicURLSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md new file mode 100644 index 0000000000..d8ec7aed65 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-authenticator.md @@ -0,0 +1,14 @@ +import { Client, Account, AuthenticatorType } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaAuthenticator( + AuthenticatorType.Totp, // type + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md new file mode 100644 index 0000000000..7d87506457 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-challenge.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaChallenge( + '', // challengeId + '' // otp +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md new file mode 100644 index 0000000000..cfbbf6f3c8 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-mfa-recovery-codes.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateMfaRecoveryCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-name.md b/docs/examples/1.5.x/client-react-native/examples/account/update-name.md new file mode 100644 index 0000000000..8a403f2ab1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-name.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateName( + '' // name +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-password.md b/docs/examples/1.5.x/client-react-native/examples/account/update-password.md new file mode 100644 index 0000000000..09edf09182 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-password.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePassword( + '', // password + 'password' // oldPassword (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md new file mode 100644 index 0000000000..cf026227fc --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-session.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneSession( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md new file mode 100644 index 0000000000..8467309a06 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhoneVerification( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md b/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md new file mode 100644 index 0000000000..46efc14142 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-phone.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePhone( + '+12065550100', // phone + 'password' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md b/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md new file mode 100644 index 0000000000..a3ff8c3408 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-prefs.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePrefs( + {} // prefs +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md b/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md new file mode 100644 index 0000000000..8096568d55 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-push-target.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updatePushTarget( + '', // targetId + '' // identifier +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md b/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md new file mode 100644 index 0000000000..1ee93d35f9 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-recovery.md @@ -0,0 +1,15 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateRecovery( + '', // userId + '', // secret + '' // password +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-session.md b/docs/examples/1.5.x/client-react-native/examples/account/update-session.md new file mode 100644 index 0000000000..397e07edc2 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-session.md @@ -0,0 +1,13 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateSession( + '' // sessionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-status.md b/docs/examples/1.5.x/client-react-native/examples/account/update-status.md new file mode 100644 index 0000000000..27ce518621 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-status.md @@ -0,0 +1,11 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateStatus(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md b/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md new file mode 100644 index 0000000000..0007335fa5 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/account/update-verification.md @@ -0,0 +1,14 @@ +import { Client, Account } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const account = new Account(client); + +const result = await account.updateVerification( + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md new file mode 100644 index 0000000000..9ceb1a39cf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-browser.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Browser } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getBrowser( + Browser.AvantBrowser, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md new file mode 100644 index 0000000000..0de631974a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-credit-card.md @@ -0,0 +1,16 @@ +import { Client, Avatars, CreditCard } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getCreditCard( + CreditCard.AmericanExpress, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md new file mode 100644 index 0000000000..6e23a774c0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-favicon.md @@ -0,0 +1,13 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFavicon( + 'https://example.com' // url +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md new file mode 100644 index 0000000000..6761052394 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-flag.md @@ -0,0 +1,16 @@ +import { Client, Avatars, Flag } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getFlag( + Flag.Afghanistan, // code + 0, // width (optional) + 0, // height (optional) + 0 // quality (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md new file mode 100644 index 0000000000..b4956df8f1 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-image.md @@ -0,0 +1,15 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getImage( + 'https://example.com', // url + 0, // width (optional) + 0 // height (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md new file mode 100644 index 0000000000..ba70a9cb03 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-initials.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getInitials( + '', // name (optional) + 0, // width (optional) + 0, // height (optional) + '' // background (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md b/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md new file mode 100644 index 0000000000..d4f2db2df8 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/avatars/get-q-r.md @@ -0,0 +1,16 @@ +import { Client, Avatars } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getQR( + '', // text + 1, // size (optional) + 0, // margin (optional) + false // download (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md new file mode 100644 index 0000000000..15d1afcdc3 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/create-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.createDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md new file mode 100644 index 0000000000..f6fef3bcdf --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/delete-document.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.deleteDocument( + '', // databaseId + '', // collectionId + '' // documentId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md new file mode 100644 index 0000000000..502f2f4640 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/get-document.md @@ -0,0 +1,16 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.getDocument( + '', // databaseId + '', // collectionId + '', // documentId + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md b/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md new file mode 100644 index 0000000000..90dcd6318c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/list-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.listDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md b/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md new file mode 100644 index 0000000000..fa04f2134a --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/databases/update-document.md @@ -0,0 +1,17 @@ +import { Client, Databases } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const databases = new Databases(client); + +const result = await databases.updateDocument( + '', // databaseId + '', // collectionId + '', // documentId + {}, // data (optional) + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md b/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md new file mode 100644 index 0000000000..1b4bfaa609 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/create-execution.md @@ -0,0 +1,18 @@ +import { Client, Functions, ExecutionMethod } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.createExecution( + '', // functionId + '', // body (optional) + false, // async (optional) + '', // path (optional) + ExecutionMethod.GET, // method (optional) + {} // headers (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md b/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md new file mode 100644 index 0000000000..adda043543 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/get-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.getExecution( + '', // functionId + '' // executionId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md b/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md new file mode 100644 index 0000000000..b1fdd6bd6f --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/functions/list-executions.md @@ -0,0 +1,15 @@ +import { Client, Functions } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listExecutions( + '', // functionId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md b/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md new file mode 100644 index 0000000000..b3c3583804 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/graphql/mutation.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.mutation( + {} // query +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/graphql/query.md b/docs/examples/1.5.x/client-react-native/examples/graphql/query.md new file mode 100644 index 0000000000..e15400d05d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/graphql/query.md @@ -0,0 +1,13 @@ +import { Client, Graphql } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const graphql = new Graphql(client); + +const result = await graphql.query( + {} // query +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/get.md b/docs/examples/1.5.x/client-react-native/examples/locale/get.md new file mode 100644 index 0000000000..4af9df39bc --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/get.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.get(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md new file mode 100644 index 0000000000..8737fde873 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-codes.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCodes(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md new file mode 100644 index 0000000000..e8c3920a17 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-continents.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listContinents(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md new file mode 100644 index 0000000000..0a2abc53c7 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-e-u.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesEU(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md new file mode 100644 index 0000000000..d4d00ae394 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries-phones.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountriesPhones(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md new file mode 100644 index 0000000000..8839b6f039 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-countries.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCountries(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md new file mode 100644 index 0000000000..6700ef1292 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-currencies.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listCurrencies(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md b/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md new file mode 100644 index 0000000000..db9b17294e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/locale/list-languages.md @@ -0,0 +1,11 @@ +import { Client, Locale } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const locale = new Locale(client); + +const result = await locale.listLanguages(); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md b/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md new file mode 100644 index 0000000000..bf5a0cec1d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/messaging/create-subscriber.md @@ -0,0 +1,15 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.createSubscriber( + '', // topicId + '', // subscriberId + '' // targetId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md b/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md new file mode 100644 index 0000000000..da995fc419 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/messaging/delete-subscriber.md @@ -0,0 +1,14 @@ +import { Client, Messaging } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const messaging = new Messaging(client); + +const result = await messaging.deleteSubscriber( + '', // topicId + '' // subscriberId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md new file mode 100644 index 0000000000..73908c6de0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/create-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.createFile( + '', // bucketId + '', // fileId + await pickSingle(), // file + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md new file mode 100644 index 0000000000..4373ebec04 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/delete-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.deleteFile( + '', // bucketId + '' // fileId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md new file mode 100644 index 0000000000..943bf9dd76 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-download.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileDownload( + '', // bucketId + '' // fileId +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md new file mode 100644 index 0000000000..76713c8694 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-preview.md @@ -0,0 +1,25 @@ +import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFilePreview( + '', // bucketId + '', // fileId + 0, // width (optional) + 0, // height (optional) + ImageGravity.Center, // gravity (optional) + 0, // quality (optional) + 0, // borderWidth (optional) + '', // borderColor (optional) + 0, // borderRadius (optional) + 0, // opacity (optional) + -360, // rotation (optional) + '', // background (optional) + ImageFormat.Jpg // output (optional) +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md new file mode 100644 index 0000000000..b551e02405 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file-view.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = storage.getFileView( + '', // bucketId + '' // fileId +); + +console.log(result); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md new file mode 100644 index 0000000000..8731c8463d --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/get-file.md @@ -0,0 +1,14 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.getFile( + '', // bucketId + '' // fileId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md b/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md new file mode 100644 index 0000000000..c72b9ba8a5 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/list-files.md @@ -0,0 +1,15 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.listFiles( + '', // bucketId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md b/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md new file mode 100644 index 0000000000..87f81ab038 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/storage/update-file.md @@ -0,0 +1,16 @@ +import { Client, Storage } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const storage = new Storage(client); + +const result = await storage.updateFile( + '', // bucketId + '', // fileId + '', // name (optional) + ["read("any")"] // permissions (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md new file mode 100644 index 0000000000..a5d6fa043e --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/create-membership.md @@ -0,0 +1,19 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +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) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/create.md b/docs/examples/1.5.x/client-react-native/examples/teams/create.md new file mode 100644 index 0000000000..f61df435a2 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/create.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.create( + '', // teamId + '', // name + [] // roles (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md new file mode 100644 index 0000000000..f5ed1bcf9c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/delete-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteMembership( + '', // teamId + '' // membershipId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/delete.md b/docs/examples/1.5.x/client-react-native/examples/teams/delete.md new file mode 100644 index 0000000000..77dac565b0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/delete.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.delete( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md new file mode 100644 index 0000000000..44a664c5db --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get-membership.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getMembership( + '', // teamId + '' // membershipId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md b/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md new file mode 100644 index 0000000000..5f7cf16921 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get-prefs.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getPrefs( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/get.md b/docs/examples/1.5.x/client-react-native/examples/teams/get.md new file mode 100644 index 0000000000..28d8895c9c --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/get.md @@ -0,0 +1,13 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.get( + '' // teamId +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md b/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md new file mode 100644 index 0000000000..afc2e39d20 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/list-memberships.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listMemberships( + '', // teamId + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/list.md b/docs/examples/1.5.x/client-react-native/examples/teams/list.md new file mode 100644 index 0000000000..cd97431d14 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/list.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.list( + [], // queries (optional) + '' // search (optional) +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md new file mode 100644 index 0000000000..85eecb9320 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership-status.md @@ -0,0 +1,16 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembershipStatus( + '', // teamId + '', // membershipId + '', // userId + '' // secret +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md new file mode 100644 index 0000000000..684c40a2d0 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-membership.md @@ -0,0 +1,15 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateMembership( + '', // teamId + '', // membershipId + [] // roles +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md new file mode 100644 index 0000000000..75f3fda4ef --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-name.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateName( + '', // teamId + '' // name +); + +console.log(response); diff --git a/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md b/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md new file mode 100644 index 0000000000..f9c4c21623 --- /dev/null +++ b/docs/examples/1.5.x/client-react-native/examples/teams/update-prefs.md @@ -0,0 +1,14 @@ +import { Client, Teams } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2'); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updatePrefs( + '', // teamId + {} // prefs +); + +console.log(response); diff --git a/docs/sdks/react-native/CHANGELOG.md b/docs/sdks/react-native/CHANGELOG.md new file mode 100644 index 0000000000..21fbe5456c --- /dev/null +++ b/docs/sdks/react-native/CHANGELOG.md @@ -0,0 +1 @@ +# Change log \ No newline at end of file diff --git a/docs/sdks/react-native/GETTING_STARTED.md b/docs/sdks/react-native/GETTING_STARTED.md new file mode 100644 index 0000000000..9d07eec54a --- /dev/null +++ b/docs/sdks/react-native/GETTING_STARTED.md @@ -0,0 +1,85 @@ + +## Getting Started + +### Add your Platform +If this is your first time using Appwrite, create an account and create your first project. + +Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps. + +#### iOS steps +Add your app **name** and **Bundle ID**. You can find your **Bundle Identifier** in the **General** tab for your app's primary target in XCode. For Expo projects you can set or find it on **app.json** file at your project's root directory. + +#### Android steps +Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level **build.gradle** file. For Expo projects you can set or find it on **app.json** file at your project's root directory. + +## Setup + +On `index.js` add import for `react-native-url-polyfill` + +``` +import 'react-native-url-polyfill/auto' +``` + +> If you are building for iOS, don't forget to install pods +> `cd ios && pod install && cd ..` + +### 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 +import { Client } from 'react-native-appwrite'; +// Init your React Native SDK +const client = new Client(); + +client + .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint + .setProject('455x34dfkj') // Your project ID + .setPlatform('com.example.myappwriteapp') // Your application ID or bundle ID. +; +``` + +### 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 +const account = new Account(client); + +// Register User +account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); + +``` + +### Full Example +```js +import { Client, Account } from 'react-native-appwrite'; +// Init your React Native SDK +const client = new Client(); + +client + .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint + .setProject('455x34dfkj') + .setPlatform('com.example.myappwriteapp') // YOUR application ID +; + +const account = new Account(client); + +// Register User +account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); +``` + +### Learn more +You can use the following resources to learn more and get help +- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/quick-starts/react-native) +- 📜 [Appwrite Docs](https://appwrite.io/docs) +- 💬 [Discord Community](https://appwrite.io/discord) +- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native) \ No newline at end of file diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 946606c7ef..22b3234027 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -15,6 +15,7 @@ use Appwrite\SDK\Language\Kotlin; use Appwrite\SDK\Language\Node; use Appwrite\SDK\Language\PHP; use Appwrite\SDK\Language\Python; +use Appwrite\SDK\Language\ReactNative; use Appwrite\SDK\Language\REST; use Appwrite\SDK\Language\Ruby; use Appwrite\SDK\Language\Swift; @@ -159,6 +160,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $config = new Flutter(); $config->setPackageName('appwrite'); break; + case 'react-native': + $config = new ReactNative(); + $config->setNPMPackage('react-native-appwrite'); + break; case 'flutter-dev': $config = new Flutter(); $config->setPackageName('appwrite_dev');