1
0
Fork 0
mirror of synced 2024-07-01 20:50:49 +12:00

Merge pull request #1165 from TorstenDittmann/fix-web-sdk-getting-started

fix(docs): web sdk getting started
This commit is contained in:
Eldad A. Fux 2021-05-24 17:36:40 +03:00 committed by GitHub
commit 6ab46910d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,8 +23,7 @@ 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) {
@ -37,17 +35,15 @@ appwrite
### 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) {