Skip to content

Commit 782148d

Browse files
committed
release: 0.1.1
1 parent 16f2270 commit 782148d

2 files changed

Lines changed: 45 additions & 2 deletions

File tree

‎packages/appwrite/README.md‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ APP_WRITE_ENDPOINT=https://[YOUR_APPWRITE_ENDPOINT]
1717
APP_WRITE_PROJECT_ID=[YOUR_APPWRITE_PROJECT_ID]
1818
```
1919

20-
Connect the client.
20+
Within you `webpack.config.js` you can also `npm install dotenv --save-dev` and configure it to load them:
21+
22+
```js
23+
require('dotenv').config();
24+
25+
module.exports = (env) => {
26+
// rest of config
27+
}
28+
```
29+
30+
### Connect Client
2131

2232
```ts
2333
import { Client, Account, ID } from '@nativescript/appwrite';
@@ -29,6 +39,39 @@ const client = new Client()
2939
const account = new Account(client);
3040
```
3141

42+
### Create Account
43+
44+
```ts
45+
const response = await account.create(ID.unique(), 'me@company.com', 'password');
46+
console.log('Account created:', response);
47+
```
48+
49+
### Login
50+
51+
```ts
52+
const response = await account.createEmailPasswordSession('me@company.com', 'password');console.log('Logged in:', response);
53+
```
54+
55+
### List Documents
56+
57+
```ts
58+
const database = new Databases(client);
59+
const documents = await database.listDocuments('database-id', 'collection-id');
60+
console.log('documents:', documents);
61+
```
62+
63+
### Create Documents
64+
65+
```ts
66+
const result = await database.createDocument(
67+
'database-id',
68+
'collection-id',
69+
crypto.randomUUID(),
70+
{ message: 'Hello World' }
71+
);
72+
console.log('Document created:', result);
73+
```
74+
3275

3376
## License
3477

‎packages/appwrite/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/appwrite",
3-
"version": "0.0.3",
3+
"version": "0.1.1",
44
"description": "Appwrite SDK for NativeScript",
55
"main": "index",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)