Merge pull request #1165 from TorstenDittmann/fix-web-sdk-getting-started
fix(docs): web sdk getting started
This commit is contained in:
commit
6ab46910d9
1 changed files with 16 additions and 20 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue