Skip to content

Commit 1569f28

Browse files
sync
1 parent 35617a8 commit 1569f28

File tree

90 files changed

+802
-1126
lines changed

Some content is hidden

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

90 files changed

+802
-1126
lines changed
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import { Client, AuthenticatorType, Account } from "appwrite";
1+
import { Client, Account, AuthenticatorType } from "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.addAuthenticator(AuthenticatorType.Totp);
9+
const result = await account.addAuthenticator(
10+
AuthenticatorType.Totp // type
11+
);
1312

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
13+
console.log(response);
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 "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: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import { Client, , Account } from "appwrite";
1+
import { Client, Account, } from "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.createChallenge(.Totp);
9+
const result = await account.createChallenge(
10+
.Totp // factor
11+
);
1312

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
13+
console.log(response);
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "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.createEmailPasswordSession('[email protected]', 'password');
9+
const result = await account.createEmailPasswordSession(
10+
'[email protected]', // email
11+
'password' // password
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "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.createEmailToken('[USER_ID]', '[email protected]');
9+
const result = await account.createEmailToken(
10+
'[USER_ID]', // userId
11+
'[email protected]', // email
12+
false // phrase (optional)
13+
);
1314

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
15+
console.log(response);
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 "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);
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "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.createMagicURLToken('[USER_ID]', '[email protected]');
9+
const result = await account.createMagicURLToken(
10+
'[USER_ID]', // userId
11+
'[email protected]', // email
12+
'https://example.com', // url (optional)
13+
false // phrase (optional)
14+
);
1315

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
16+
console.log(response);
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { Client, OAuthProvider, Account } from "appwrite";
1+
import { Client, Account, OAuthProvider } from "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-
// Go to OAuth provider login page
13-
account.createOAuth2Session(OAuthProvider.Amazon);
9+
account.createOAuth2Session(
10+
OAuthProvider.Amazon, // provider
11+
'https://example.com', // success (optional)
12+
'https://example.com', // failure (optional)
13+
false, // token (optional)
14+
[] // scopes (optional)
15+
);
1416

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { Client, Account } from "appwrite";
1+
import { Client, Account } from "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.createPhoneToken('[USER_ID]', '+12065550100');
9+
const result = await account.createPhoneToken(
10+
'[USER_ID]', // userId
11+
'+12065550100' // phone
12+
);
1313

14-
promise.then(function (response) {
15-
console.log(response); // Success
16-
}, function (error) {
17-
console.log(error); // Failure
18-
});
14+
console.log(response);
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 "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.createPhoneVerification();
9+
const result = await account.createPhoneVerification();
1310

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

0 commit comments

Comments
 (0)