Skip to content

Commit c312360

Browse files
committed
2 parents 1022175 + 6fa5391 commit c312360

4 files changed

Lines changed: 30 additions & 6 deletions

File tree

‎packages/appwrite/README.md‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11
# @nativescript/appwrite
22

3-
```javascript
3+
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 Appwrite SDK for NativeScript to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
4+
5+
```bash
46
npm install @nativescript/appwrite
57
```
68

79
## Usage
810

9-
// TODO
11+
Register an Appwrite account [here](https://appwrite.io/) and create a project to gather your endpoint and project id.
12+
13+
Setup a `.env` file at the root of your project with the following:
14+
15+
```base
16+
APP_WRITE_ENDPOINT=https://[YOUR_APPWRITE_ENDPOINT]
17+
APP_WRITE_PROJECT_ID=[YOUR_APPWRITE_PROJECT_ID]
18+
```
19+
20+
Connect the client.
21+
22+
```ts
23+
import { Client, Account, ID } from '@nativescript/appwrite';
24+
25+
const client = new Client()
26+
.setEndpoint(process.env.APP_WRITE_ENDPOINT)
27+
.setProject(process.env.APP_WRITE_PROJECT_ID)
28+
.setSelfSigned(true); // for development
29+
const account = new Account(client);
30+
```
31+
1032

1133
## License
1234

‎packages/appwrite/package.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nativescript/appwrite",
3-
"version": "1.0.0",
4-
"description": "Add a plugin description",
3+
"version": "0.0.3",
4+
"description": "Appwrite SDK for NativeScript",
55
"main": "index",
66
"types": "index.d.ts",
77
"nativescript": {
@@ -19,7 +19,8 @@
1919
"JavaScript",
2020
"TypeScript",
2121
"iOS",
22-
"Android"
22+
"Android",
23+
"Appwrite"
2324
],
2425
"author": {
2526
"name": "NativeScript",

‎packages/appwrite/project.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"assets": [
1515
"packages/appwrite/*.md",
1616
"packages/appwrite/index.d.ts",
17+
"packages/appwrite/nativescript.config.ts",
1718
"LICENSE",
1819
{
1920
"glob": "**/*",

‎packages/appwrite/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"outDir": "../../dist/out-tsc",
55
"rootDir": "."
66
},
7-
"exclude": ["**/*.spec.ts", "**/*.test.ts", "angular"],
7+
"exclude": ["**/*.spec.ts", "**/*.test.ts", "angular", "nativescript.config.ts"],
88
"include": ["**/*.ts", "references.d.ts"]
99
}

0 commit comments

Comments
 (0)