Skip to content

Commit 92552af

Browse files
committed
Release candidate for 1.5.x
1 parent b3d5b1a commit 92552af

File tree

181 files changed

+6994
-532
lines changed

Some content is hidden

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

181 files changed

+6994
-532
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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-node/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-node/releases).**
1010

1111
> This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code.
1212
If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
.setSession('') // The user session to authenticate with
12+
;
13+
14+
const promise = account.addAuthenticator(sdk..Totp);
15+
16+
promise.then(function (response) {
17+
console.log(response);
18+
}, function (error) {
19+
console.log(error);
20+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createAnonymousSession();
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createEmailPasswordSession('email@example.com', 'password');
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createEmailToken('[USER_ID]', 'email@example.com');
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createJWT();
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createMagicURLToken('[USER_ID]', 'email@example.com');
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createOAuth2Session(sdk.OAuthProvider.Amazon);
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const sdk = require('node-appwrite');
2+
3+
// Init SDK
4+
const client = new sdk.Client();
5+
6+
const account = new sdk.Account(client);
7+
8+
client
9+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
10+
.setProject('5df5acd0d48c2') // Your project ID
11+
;
12+
13+
const promise = account.createPhoneToken('[USER_ID]', '+12065550100');
14+
15+
promise.then(function (response) {
16+
console.log(response);
17+
}, function (error) {
18+
console.log(error);
19+
});

docs/examples/account/create-phone-verification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const account = new sdk.Account(client);
88
client
99
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
1010
.setProject('5df5acd0d48c2') // Your project ID
11-
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
11+
.setSession('') // The user session to authenticate with
1212
;
1313

1414
const promise = account.createPhoneVerification();

0 commit comments

Comments
 (0)