Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
eldadfux committed May 24, 2021
1 parent 39402eb commit 6d339cf
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ Initialize your SDK code with your project ID which can be found in your project

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

appwrite
sdk
.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 @@ -64,35 +63,32 @@ Once your SDK object is set, access any of the Appwrite services and choose any

```js
// Register User
appwrite
.account.create('me@example.com', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
sdk.account.create('me@example.com', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});

```

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

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

// Register User
appwrite
.account.create('me@example.com', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
sdk.account.create('me@example.com', 'password', 'Jane Doe')
.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
```

### Learn more
Expand Down

0 comments on commit 6d339cf

Please sign in to comment.