Skip to content

Commit 64cdc3e

Browse files
committed
Added TypeScript support for optional parameters
1 parent 3f71ea1 commit 64cdc3e

File tree

113 files changed

+1257
-143
lines changed

Some content is hidden

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

113 files changed

+1257
-143
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite Web SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-js.svg?v=1)
4-
![Version](https://img.shields.io/badge/api%20version-0.6.0-blue.svg?v=1)
4+
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
55

66
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.
77
Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
@@ -30,9 +30,24 @@ import * as Appwrite from "appwrite";
3030
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:
3131

3232
```html
33-
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.1.0"></script>
33+
<script src="https://cdn.jsdelivr.net/npm/appwrite@1.2.0"></script>
3434
```
3535

36+
## Getting Started
37+
38+
Initialise the Appwrite SDK in your code, and setup your API credentials:
39+
40+
```js
41+
42+
// Init your Web SDK
43+
var appwrite = new Appwrite();
44+
45+
appwrite
46+
.setEndpoint('http://localhost/v1') // Set only when using self-hosted solution
47+
.setProject('455x34dfkj') // Your Appwrite Project UID
48+
;
49+
50+
```
3651

3752

3853
## Contribution
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

7-
let promise = sdk.account.createOAuth2Session('bitbucket');
8+
// Go to OAuth provider login page
9+
sdk.account.createOAuth2Session('amazon');
810

9-
promise.then(function (response) {
10-
console.log(response); // Success
11-
}, function (error) {
12-
console.log(error); // Failure
13-
});

docs/examples/account/create-recovery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/create-session.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/create-verification.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/create.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/delete-session.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/delete-sessions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/delete.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

docs/examples/account/get-logs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
let sdk = new Appwrite();
22

33
sdk
4+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
45
.setProject('5df5acd0d48c2') // Your project ID
56
;
67

0 commit comments

Comments
 (0)