1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +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
// 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