1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

fix(docs): web sdk getting started

This commit is contained in:
Torsten Dittmann 2021-05-20 14:40:41 +02:00
parent c454bc2a65
commit 7ea0871dc9

View file

@ -10,12 +10,11 @@ Initialize your SDK code with your project ID which can be found in your project
```js ```js
// Init your Web SDK // Init your Web SDK
const appwrite = new Appwrite(); const sdk = new Appwrite();
appwrite sdk
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
.setProject('455x34dfkj') // Your project ID .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 ```js
// Register User // Register User
appwrite sdk.account.create('me@example.com', 'password', 'Jane Doe')
.account.create('me@example.com', 'password', 'Jane Doe') .then(function (response) {
.then(function (response) { console.log(response);
console.log(response); }, function (error) {
}, function (error) { console.log(error);
console.log(error); });
});
``` ```
### Full Example ### Full Example
```js ```js
// Init your Web SDK // Init your Web SDK
const appwrite = new Appwrite(); const sdk = new Appwrite();
appwrite sdk
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
.setProject('455x34dfkj') .setProject('455x34dfkj')
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
; ;
// Register User // Register User
appwrite sdk.account.create('me@example.com', 'password', 'Jane Doe')
.account.create('me@example.com', 'password', 'Jane Doe') .then(function (response) {
.then(function (response) { console.log(response);
console.log(response); }, function (error) {
}, function (error) { console.log(error);
console.log(error); });
});
``` ```
### Learn more ### Learn more