Skip to content

Commit 81d81af

Browse files
change iife namespace from to
1 parent 652bfac commit 81d81af

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { Appwrite } from "appwrite";
3434
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3535

3636
```html
37-
<script src="https://cdn.jsdelivr.net/npm/appwrite@3.0.5"></script>
37+
<script src="https://cdn.jsdelivr.net/npm/appwrite@3.1.0"></script>
3838
```
3939

4040

@@ -50,9 +50,9 @@ Initialize your SDK code with your project ID which can be found in your project
5050

5151
```js
5252
// Init your Web SDK
53-
const appwrite = new Appwrite();
53+
const sdk = new Appwrite();
5454

55-
appwrite
55+
sdk
5656
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
5757
.setProject('455x34dfkj') // Your project ID
5858
;
@@ -63,34 +63,32 @@ Once your SDK object is set, access any of the Appwrite services and choose any
6363

6464
```js
6565
// Register User
66-
appwrite
67-
.account.create('[email protected]', 'password', 'Jane Doe')
68-
.then(function (response) {
69-
console.log(response);
70-
}, function (error) {
71-
console.log(error);
72-
});
66+
sdk.account.create('[email protected]', 'password', 'Jane Doe')
67+
.then(function (response) {
68+
console.log(response);
69+
}, function (error) {
70+
console.log(error);
71+
});
7372

7473
```
7574

7675
### Full Example
7776
```js
7877
// Init your Web SDK
79-
const appwrite = new Appwrite();
78+
const sdk = new Appwrite();
8079

81-
appwrite
80+
sdk
8281
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
8382
.setProject('455x34dfkj')
8483
;
8584

8685
// Register User
87-
appwrite
88-
.account.create('[email protected]', 'password', 'Jane Doe')
89-
.then(function (response) {
90-
console.log(response);
91-
}, function (error) {
92-
console.log(error);
93-
});
86+
sdk.account.create('[email protected]', 'password', 'Jane Doe')
87+
.then(function (response) {
88+
console.log(response);
89+
}, function (error) {
90+
console.log(error);
91+
});
9492
```
9593

9694
### Learn more

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "3.0.5",
5+
"version": "3.1.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {

rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default {
2020
{
2121
format: "iife",
2222
file: pkg.jsdelivr,
23-
name: "Appwrite",
24-
esModule: false,
23+
name: "window",
24+
extend: true,
2525
globals: {
2626
"cross-fetch": "window",
2727
"FormData": "FormData",

src/sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Appwrite {
2929
locale: '',
3030
};
3131
headers: Headers = {
32-
'x-sdk-version': 'appwrite:web:3.0.5',
32+
'x-sdk-version': 'appwrite:web:3.1.0',
3333
'X-Appwrite-Response-Format': '0.8.0',
3434
};
3535

0 commit comments

Comments
 (0)