Skip to content

Commit 897b6cf

Browse files
Merge pull request #12 from appwrite/dev
1.5.x support
2 parents d53b216 + 43cb69e commit 897b6cf

File tree

128 files changed

+2373
-12598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2373
-12598
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7-
87

98
jobs:
109
publish:
@@ -20,14 +19,24 @@ jobs:
2019
node-version: '20.x'
2120
registry-url: 'https://registry.npmjs.org'
2221

22+
# Determine release tag based on the tag name
23+
- name: Determine release tag
24+
id: release_tag
25+
run: |
26+
if [[ "${{ github.ref }}" == *"-rc"* ]] || [[ "${{ github.ref }}" == *"-RC"* ]]; then
27+
echo "tag=next" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "tag=latest" >> "$GITHUB_OUTPUT"
30+
fi
31+
2332
# Install dependencies (if any) and build your project (if necessary)
2433
- name: Install dependencies and build
2534
run: |
2635
npm install
2736
npm run build
2837
29-
# Publish to NPM
38+
# Publish to NPM with the appropriate tag
3039
- name: Publish
31-
run: npm publish
40+
run: npm publish --tag ${{ steps.release_tag.outputs.tag }}
3241
env:
33-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Change Log
1+
# Change log

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Appwrite React Native SDK [BETA]
1+
# Appwrite React Native SDK
22

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

9-
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
9+
**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
1010

1111
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 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)
1212

@@ -20,6 +20,8 @@ To install
2020
npx expo install react-native-appwrite react-native-url-polyfill
2121
```
2222

23+
24+
2325
## Getting Started
2426

2527
### Add your Platform
@@ -28,19 +30,28 @@ If this is your first time using Appwrite, create an account and create your fir
2830
Then, under **Add a platform**, add a **Android app** or a **Apple app**. You can skip optional steps.
2931

3032
#### iOS steps
31-
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.
33+
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.
3234

3335
#### Android steps
34-
Add your app's **name** and **package name**, Your package name is generally the **applicationId** in your app-level `build.gradle` file.
36+
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.
3537

3638
## Setup
3739

40+
On `index.js` add import for `react-native-url-polyfill`
41+
42+
```
43+
import 'react-native-url-polyfill/auto'
44+
```
45+
46+
> If you are building for iOS, don't forget to install pods
47+
> `cd ios && pod install && cd ..`
48+
3849
### Init your SDK
3950
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
4051

4152
```js
4253
import { Client } from 'react-native-appwrite';
43-
// Init your react-native SDK
54+
// Init your React Native SDK
4455
const client = new Client();
4556

4657
client
@@ -63,12 +74,13 @@ account.create(ID.unique(), '[email protected]', 'password', 'Jane Doe')
6374
}, function (error) {
6475
console.log(error);
6576
});
77+
6678
```
6779

6880
### Full Example
6981
```js
7082
import { Client, Account } from 'react-native-appwrite';
71-
// Init your Web SDK
83+
// Init your React Native SDK
7284
const client = new Client();
7385

7486
client
@@ -95,9 +107,10 @@ You can use the following resources to learn more and get help
95107
- 💬 [Discord Community](https://appwrite.io/discord)
96108
- 🚂 [Appwrite React Native Playground](https://github.com/appwrite/playground-for-react-native)
97109

98-
99110
## Contribution
111+
100112
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
101113

102114
## License
103-
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
115+
116+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "react-native-appwrite";
22

3-
const client = new Client();
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
46

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createAnonymousSession();
9+
const result = await account.createAnonymousSession();
1310

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
11+
console.log(response);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Client, Account } from "react-native-appwrite";
2+
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
const account = new Account(client);
8+
9+
const result = await account.createEmailPasswordSession(
10+
'[email protected]', // email
11+
'password' // password
12+
);
13+
14+
console.log(response);

docs/examples/account/create-email-session.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Client, Account } from "react-native-appwrite";
2+
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
6+
7+
const account = new Account(client);
8+
9+
const result = await account.createEmailToken(
10+
'<USER_ID>', // userId
11+
'[email protected]', // email
12+
false // phrase (optional)
13+
);
14+
15+
console.log(response);

docs/examples/account/create-j-w-t.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "react-native-appwrite";
22

3-
const client = new Client();
3+
const client = new Client()
4+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('5df5acd0d48c2'); // Your project ID
46

57
const account = new Account(client);
68

7-
client
8-
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9-
.setProject('5df5acd0d48c2') // Your project ID
10-
;
11-
12-
const promise = account.createJWT();
9+
const result = await account.createJWT();
1310

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
11+
console.log(response);

docs/examples/account/create-magic-u-r-l-session.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)