Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.14.1'
registry-url: 'https://registry.npmjs.org'
Expand All @@ -36,8 +36,8 @@ jobs:

- name: Install dependencies, audit, and build
run: |
npm ci
npm audit --audit-level=high --omit=dev
npm ci --omit=peer
npm audit --audit-level=high --omit=dev --omit=peer
npm run build

- name: Publish
Expand Down
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
dist/
types/
package-lock.json

# CI workflow files follow the YAML conventions of the publishing repository,
# not this SDK's source formatting.
.github/

# README and CHANGELOG carry caller-supplied markdown verbatim, which this
# SDK's formatter must not rewrite.
README.md
CHANGELOG.md
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 4,
"singleQuote": true
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change log

## 0.35.0

* Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType`
* Breaking: `react-native` is now a peer dependency instead of a dependency
* Breaking: SDK now targets Appwrite 2.0 (`X-Appwrite-Response-Format: 2.0.0`)
* Added: `DocumentsDB` and `VectorsDB` services for document and vector database access
* Added: `Organization` service with `listInstallations`, `createInstallation`, `getInstallation`, `updateInstallation`, `deleteInstallation`
* Added: `Teams` installation methods `listInstallations`, `createInstallation`, `getInstallation`, `updateInstallation`, `deleteInstallation`
* Added: `Account` consent methods `listConsents`, `getConsent`, `deleteConsent`, `listConsentTokens`, `getConsentToken`, `deleteConsentToken`
* Added: `Avatars.getPhoto` returning the best available user profile photo
* Added: `folder` parameter to `Storage.createFile` and `folder`, `key` fields on `File`
* Added: `ExecutionResourceType` enum with `Functions` and `Sites`
* Added: `AppInstallation`, `Oauth2Consent`, `Oauth2ConsentToken` models and list types
* Added: `Custom` value to `AuthenticationFactor` and `custom` field on `MfaFactors`
* Added: `Cloudflare`, `Huggingface`, `Resend` values to `OAuthProvider`
* Added: `Auto` value to `ImageGravity` enum
* Updated: source formatted with Prettier and linted with ESLint
* Fixed: positional calls with an `undefined` leading argument and trailing arguments dispatch correctly

## 0.34.0

* Added: `Client.setBearer()` method for OAuth access token authentication
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite React Native SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-react-native.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.0.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
**This SDK targets Appwrite server version 2.0.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies 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 React Native 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)

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -9,7 +9,7 @@ const account = new Account(client);

const result = await account.createEmailPasswordSession({
email: 'email@example.com',
password: 'password'
password: 'password',
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ const account = new Account(client);
const result = await account.createEmailToken({
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false // optional
phrase: false, // optional
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-email-verification.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.createEmailVerification({
url: 'https://example.com'
url: 'https://example.com',
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.createJWT({
duration: 0 // optional
duration: 0, // optional
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await account.createMagicURLToken({
userId: '<USER_ID>',
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false // optional
phrase: false, // optional
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account, AuthenticatorType } from "react-native-appwrite";
import { Client, Account, AuthenticatorType } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.createMFAAuthenticator({
type: AuthenticatorType.Totp
type: AuthenticatorType.Totp,
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account, AuthenticationFactor } from "react-native-appwrite";
import { Client, Account, AuthenticationFactor } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.createMFAChallenge({
factor: AuthenticationFactor.Email
factor: AuthenticationFactor.Email,
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
5 changes: 2 additions & 3 deletions docs/examples/account/create-o-auth-2-session.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account, OAuthProvider } from "react-native-appwrite";
import { Client, Account, OAuthProvider } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,6 @@ account.createOAuth2Session({
provider: OAuthProvider.Amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
scopes: [], // optional
});

```
5 changes: 2 additions & 3 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account, OAuthProvider } from "react-native-appwrite";
import { Client, Account, OAuthProvider } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,6 @@ account.createOAuth2Token({
provider: OAuthProvider.Amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [] // optional
scopes: [], // optional
});

```
4 changes: 2 additions & 2 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -9,7 +9,7 @@ const account = new Account(client);

const result = await account.createPhoneToken({
userId: '<USER_ID>',
phone: '+12065550100'
phone: '+12065550100',
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-push-target.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -10,7 +10,7 @@ const account = new Account(client);
const result = await account.createPushTarget({
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
providerId: '<PROVIDER_ID>' // optional
providerId: '<PROVIDER_ID>', // optional
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-recovery.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -9,7 +9,7 @@ const account = new Account(client);

const result = await account.createRecovery({
email: 'email@example.com',
url: 'https://example.com'
url: 'https://example.com',
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -9,7 +9,7 @@ const account = new Account(client);

const result = await account.createSession({
userId: '<USER_ID>',
secret: '<SECRET>'
secret: '<SECRET>',
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create-verification.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.createVerification({
url: 'https://example.com'
url: 'https://example.com',
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/account/create.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -11,7 +11,7 @@ const result = await account.create({
userId: '<USER_ID>',
email: 'email@example.com',
password: 'password',
name: '<NAME>' // optional
name: '<NAME>', // optional
});

console.log(result);
Expand Down
16 changes: 16 additions & 0 deletions docs/examples/account/delete-consent-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.deleteConsentToken({
consentId: '<CONSENT_ID>',
tokenId: '<TOKEN_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/account/delete-consent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const account = new Account(client);

const result = await account.deleteConsent({
consentId: '<CONSENT_ID>',
});

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/account/delete-identity.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Account } from "react-native-appwrite";
import { Client, Account } from 'react-native-appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const account = new Account(client);

const result = await account.deleteIdentity({
identityId: '<IDENTITY_ID>'
identityId: '<IDENTITY_ID>',
});

console.log(result);
Expand Down
Loading