Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request appwrite#90 from appwrite/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
abnegate authored Mar 8, 2024
2 parents bf13f87 + 6dacbc2 commit e907a87
Show file tree
Hide file tree
Showing 121 changed files with 2,166 additions and 1,087 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_js:
jobs:
include:
- stage: NPM RC Release
if: tag =~ /-(rc|RC)/
if: tag == *-rc*
node_js: "14.16"
script:
- npm install
Expand All @@ -17,7 +17,7 @@ jobs:
api_key: $NPM_API_KEY
tag: next
- stage: NPM Release
if: not tag =~ /-(rc|RC)/
if: tag != *-rc*
node_js: "14.16"
script:
- npm install
Expand All @@ -29,4 +29,4 @@ jobs:
api_key: $NPM_API_KEY
skip_cleanup: true
on:
tags: true
tags: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Appwrite Web SDK

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

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

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 Web 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)

![Appwrite](https://appwrite.io/images/github.png)
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)

## Installation

Expand All @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@13.0.1"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@14.0.0"></script>
```


Expand Down Expand Up @@ -64,7 +64,7 @@ Once your SDK object is set, access any of the Appwrite services and choose any
const account = new Account(client);

// Register User
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien")
.then(function (response) {
console.log(response);
}, function (error) {
Expand All @@ -86,7 +86,7 @@ client
const account = new Account(client);

// Register User
account.create(ID.unique(), 'me@example.com', 'password', 'Jane Doe')
account.create(ID.unique(), "email@example.com", "password", "Walter O'Brien")
.then(function (response) {
console.log(response);
}, function (error) {
Expand Down
17 changes: 5 additions & 12 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createAnonymousSession();
const result = await account.createAnonymousSession();

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(response);
14 changes: 14 additions & 0 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createEmailPasswordSession(
'[email protected]', // email
'password' // password
);

console.log(response);
18 changes: 0 additions & 18 deletions docs/examples/account/create-email-session.md

This file was deleted.

15 changes: 15 additions & 0 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createEmailToken(
'<USER_ID>', // userId
'[email protected]', // email
false // phrase (optional)
);

console.log(response);
17 changes: 5 additions & 12 deletions docs/examples/account/create-j-w-t.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createJWT();
const result = await account.createJWT();

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(response);
18 changes: 0 additions & 18 deletions docs/examples/account/create-magic-u-r-l-session.md

This file was deleted.

16 changes: 16 additions & 0 deletions docs/examples/account/create-magic-u-r-l-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createMagicURLToken(
'<USER_ID>', // userId
'[email protected]', // email
'https://example.com', // url (optional)
false // phrase (optional)
);

console.log(response);
13 changes: 13 additions & 0 deletions docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account, AuthenticatorType } from "appwrite";

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

const account = new Account(client);

const result = await account.createMfaAuthenticator(
AuthenticatorType.Totp // type
);

console.log(response);
13 changes: 13 additions & 0 deletions docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Account, AuthenticationFactor } from "appwrite";

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

const account = new Account(client);

const result = await account.createMfaChallenge(
AuthenticationFactor.Email // factor
);

console.log(response);
11 changes: 11 additions & 0 deletions docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createMfaRecoveryCodes();

console.log(response);
19 changes: 10 additions & 9 deletions docs/examples/account/create-o-auth2session.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Client, Account } from "appwrite";
import { Client, Account, OAuthProvider } from "appwrite";

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

const account = new Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;

// Go to OAuth provider login page
account.createOAuth2Session('amazon');
account.createOAuth2Session(
OAuthProvider.Amazon, // provider
'https://example.com', // success (optional)
'https://example.com', // failure (optional)
[] // scopes (optional)
);

15 changes: 15 additions & 0 deletions docs/examples/account/create-o-auth2token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Account, OAuthProvider } from "appwrite";

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

const account = new Account(client);

account.createOAuth2Token(
OAuthProvider.Amazon, // provider
'https://example.com', // success (optional)
'https://example.com', // failure (optional)
[] // scopes (optional)
);

18 changes: 0 additions & 18 deletions docs/examples/account/create-phone-session.md

This file was deleted.

14 changes: 14 additions & 0 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createPhoneToken(
'<USER_ID>', // userId
'+12065550100' // phone
);

console.log(response);
17 changes: 5 additions & 12 deletions docs/examples/account/create-phone-verification.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.createPhoneVerification();
const result = await account.createPhoneVerification();

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
console.log(response);
15 changes: 15 additions & 0 deletions docs/examples/account/create-push-target.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Client, Account } from "appwrite";

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

const account = new Account(client);

const result = await account.createPushTarget(
'<TARGET_ID>', // targetId
'<IDENTIFIER>', // identifier
'<PROVIDER_ID>' // providerId (optional)
);

console.log(response);
Loading

0 comments on commit e907a87

Please sign in to comment.