Skip to content

Commit

Permalink
add param checking and removed default values
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Jun 2, 2021
1 parent 6d339cf commit 49de3c5
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 167 deletions.
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Appwrite } 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/[email protected].4"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
```


Expand All @@ -50,11 +50,12 @@ Initialize your SDK code with your project ID which can be found in your project

```js
// Init your Web SDK
const sdk = new Appwrite();
const appwrite = new Appwrite();

sdk
appwrite
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
.setProject('455x34dfkj') // Your project ID
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
;
```

Expand All @@ -63,32 +64,35 @@ Once your SDK object is set, access any of the Appwrite services and choose any

```js
// Register User
sdk.account.create('[email protected]', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
appwrite
.account.create('[email protected]', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});

```

### Full Example
```js
// Init your Web SDK
const sdk = new Appwrite();
const appwrite = new Appwrite();

sdk
appwrite
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
.setProject('455x34dfkj')
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
;

// Register User
sdk.account.create('[email protected]', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
appwrite
.account.create('[email protected]', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
```

### Learn more
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "appwrite",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
"version": "3.0.4",
"version": "3.0.5",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
Loading

0 comments on commit 49de3c5

Please sign in to comment.