Skip to content

Commit 870c3b3

Browse files
committed
first commit
0 parents  commit 870c3b3

File tree

106 files changed

+14222
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+14222
-0
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug.yaml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "🐛 Bug Report"
2+
description: "Submit a bug report to help us improve"
3+
title: "🐛 Bug Report: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out our bug report form 🙏
10+
- type: textarea
11+
id: steps-to-reproduce
12+
validations:
13+
required: true
14+
attributes:
15+
label: "👟 Reproduction steps"
16+
description: "How do you trigger this bug? Please walk us through it step by step."
17+
placeholder: "When I ..."
18+
- type: textarea
19+
id: expected-behavior
20+
validations:
21+
required: true
22+
attributes:
23+
label: "👍 Expected behavior"
24+
description: "What did you think would happen?"
25+
placeholder: "It should ..."
26+
- type: textarea
27+
id: actual-behavior
28+
validations:
29+
required: true
30+
attributes:
31+
label: "👎 Actual Behavior"
32+
description: "What did actually happen? Add screenshots, if applicable."
33+
placeholder: "It actually ..."
34+
- type: dropdown
35+
id: appwrite-version
36+
attributes:
37+
label: "🎲 Appwrite version"
38+
description: "What version of Appwrite are you running?"
39+
options:
40+
- Version 0.10.x
41+
- Version 0.9.x
42+
- Version 0.8.x
43+
- Version 0.7.x
44+
- Version 0.6.x
45+
- Different version (specify in environment)
46+
validations:
47+
required: true
48+
- type: dropdown
49+
id: operating-system
50+
attributes:
51+
label: "💻 Operating system"
52+
description: "What OS is your server / device running on?"
53+
options:
54+
- Linux
55+
- MacOS
56+
- Windows
57+
- Something else
58+
validations:
59+
required: true
60+
- type: textarea
61+
id: enviromnemt
62+
validations:
63+
required: false
64+
attributes:
65+
label: "🧱 Your Environment"
66+
description: "Is your environment customized in any way?"
67+
placeholder: "I use Cloudflare for ..."
68+
- type: checkboxes
69+
id: no-duplicate-issues
70+
attributes:
71+
label: "👀 Have you spent some time to check if this issue has been raised before?"
72+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
73+
options:
74+
- label: "I checked and didn't find similar issue"
75+
required: true
76+
- type: checkboxes
77+
id: read-code-of-conduct
78+
attributes:
79+
label: "🏢 Have you read the Code of Conduct?"
80+
options:
81+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
82+
required: true

Diff for: .github/ISSUE_TEMPLATE/documentation.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "📚 Documentation"
2+
description: "Report an issue related to documentation"
3+
title: "📚 Documentation: "
4+
labels: [documentation]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to make our documentation better 🙏
10+
- type: textarea
11+
id: issue-description
12+
validations:
13+
required: true
14+
attributes:
15+
label: "💭 Description"
16+
description: "A clear and concise description of what the issue is."
17+
placeholder: "Documentation should not ..."
18+
- type: checkboxes
19+
id: no-duplicate-issues
20+
attributes:
21+
label: "👀 Have you spent some time to check if this issue has been raised before?"
22+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
23+
options:
24+
- label: "I checked and didn't find similar issue"
25+
required: true
26+
- type: checkboxes
27+
id: read-code-of-conduct
28+
attributes:
29+
label: "🏢 Have you read the Code of Conduct?"
30+
options:
31+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
32+
required: true

Diff for: .github/ISSUE_TEMPLATE/feature.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 🚀 Feature
2+
description: "Submit a proposal for a new feature"
3+
title: "🚀 Feature: "
4+
labels: [feature]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out our feature request form 🙏
10+
- type: textarea
11+
id: feature-description
12+
validations:
13+
required: true
14+
attributes:
15+
label: "🔖 Feature description"
16+
description: "A clear and concise description of what the feature is."
17+
placeholder: "You should add ..."
18+
- type: textarea
19+
id: pitch
20+
validations:
21+
required: true
22+
attributes:
23+
label: "🎤 Pitch"
24+
description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable."
25+
placeholder: "In my use-case, ..."
26+
- type: checkboxes
27+
id: no-duplicate-issues
28+
attributes:
29+
label: "👀 Have you spent some time to check if this issue has been raised before?"
30+
description: "Have you Googled for a similar issue or checked our older issues for a similar bug?"
31+
options:
32+
- label: "I checked and didn't find similar issue"
33+
required: true
34+
- type: checkboxes
35+
id: read-code-of-conduct
36+
attributes:
37+
label: "🏢 Have you read the Code of Conduct?"
38+
options:
39+
- label: "I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)"
40+
required: true

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
types/

Diff for: .gitpod.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6+
7+
tasks:
8+
- init: npm install && npm run build
9+
10+

Diff for: .travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: node_js
2+
node_js:
3+
- "14.16"
4+
5+
jobs:
6+
include:
7+
- stage: NPM RC Release
8+
if: tag =~ /-(rc|RC)/
9+
node_js: "14.16"
10+
script:
11+
- npm install
12+
- npm run build
13+
- echo "Deploying RC to NPM..."
14+
deploy:
15+
provider: npm
16+
email: $NPM_EMAIL
17+
api_key: $NPM_API_KEY
18+
tag: next
19+
- stage: NPM Release
20+
if: not tag =~ /-(rc|RC)/
21+
node_js: "14.16"
22+
script:
23+
- npm install
24+
- npm run build
25+
- echo "Deploying to NPM..."
26+
deploy:
27+
provider: npm
28+
email: $NPM_EMAIL
29+
api_key: $NPM_API_KEY
30+
skip_cleanup: true
31+
on:
32+
tags: true

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Change Log

Diff for: LICENSE

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Diff for: README.md

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Appwrite Web SDK
2+
3+
![License](https://img.shields.io/github/license/appwrite/sdk-for-web.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square)
5+
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6+
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
7+
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
8+
9+
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-web/releases).**
10+
11+
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Web SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
12+
13+
![Appwrite](https://appwrite.io/images/github.png)
14+
15+
## Installation
16+
17+
### NPM
18+
19+
To install via [NPM](https://www.npmjs.com/):
20+
21+
```bash
22+
npm install appwrite --save
23+
```
24+
25+
If you're using a bundler (like [Rollup](https://rollupjs.org/) or [webpack](https://webpack.js.org/)), you can import the Appwrite module when you need it:
26+
27+
```js
28+
import { Client, Account } from "appwrite";
29+
```
30+
31+
### CDN
32+
33+
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:
34+
35+
```html
36+
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
37+
```
38+
39+
40+
## Getting Started
41+
42+
### Add your Web Platform
43+
For you to init your SDK and interact with Appwrite services you need to add a web platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before and click the 'Add Platform' button.
44+
45+
From the options, choose to add a **Web** platform and add your client app hostname. By adding your hostname to your project platform you are allowing cross-domain communication between your project and the Appwrite API.
46+
47+
### Init your SDK
48+
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
49+
50+
```js
51+
// Init your Web SDK
52+
const client = new Client();
53+
54+
client
55+
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
56+
.setProject('455x34dfkj') // Your project ID
57+
;
58+
```
59+
60+
### Make Your First Request
61+
Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
62+
63+
```js
64+
const account = new Account(client);
65+
66+
// Register User
67+
account.create(ID.unique(), '[email protected]', 'password', 'Jane Doe')
68+
.then(function (response) {
69+
console.log(response);
70+
}, function (error) {
71+
console.log(error);
72+
});
73+
74+
```
75+
76+
### Full Example
77+
```js
78+
// Init your Web SDK
79+
const client = new Client();
80+
81+
client
82+
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
83+
.setProject('455x34dfkj')
84+
;
85+
86+
const account = new Account(client);
87+
88+
// Register User
89+
account.create(ID.unique(), '[email protected]', 'password', 'Jane Doe')
90+
.then(function (response) {
91+
console.log(response);
92+
}, function (error) {
93+
console.log(error);
94+
});
95+
```
96+
97+
### Learn more
98+
You can use the following resources to learn more and get help
99+
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-web)
100+
- 📜 [Appwrite Docs](https://appwrite.io/docs)
101+
- 💬 [Discord Community](https://appwrite.io/discord)
102+
- 🚂 [Appwrite Web Playground](https://github.com/appwrite/playground-for-web)
103+
104+
105+
## Contribution
106+
107+
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
108+
109+
## License
110+
111+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

Diff for: docs/examples/account/create-anonymous-session.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Account } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const account = new Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = account.createAnonymousSession();
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});

Diff for: docs/examples/account/create-email-session.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Account } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const account = new Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = account.createEmailSession('[email protected]', 'password');
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});

Diff for: docs/examples/account/create-j-w-t.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Client, Account } from "appwrite";
2+
3+
const client = new Client();
4+
5+
const account = new Account(client);
6+
7+
client
8+
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
12+
const promise = account.createJWT();
13+
14+
promise.then(function (response) {
15+
console.log(response); // Success
16+
}, function (error) {
17+
console.log(error); // Failure
18+
});

0 commit comments

Comments
 (0)