Merge pull request #1165 from TorstenDittmann/fix-web-sdk-getting-started
fix(docs): web sdk getting started
This commit is contained in:
commit
6ab46910d9
|
@ -10,12 +10,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
|
||||
;
|
||||
```
|
||||
|
||||
|
@ -24,35 +23,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
|
||||
|
|
Loading…
Reference in a new issue