Merge branch 'dev' of github.com:appwrite/appwrite into 0.8.x
This commit is contained in:
commit
db4530a5e5
11 changed files with 174 additions and 1 deletions
|
@ -6,6 +6,10 @@
|
||||||
- Added new Environment Variable to enable or disable Anonymous Login
|
- Added new Environment Variable to enable or disable Anonymous Login
|
||||||
- Added events for functions and executions (#971)
|
- Added events for functions and executions (#971)
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
|
||||||
|
- Fixed default value for HTTPS force option
|
||||||
|
|
||||||
## Breaking Changes
|
## Breaking Changes
|
||||||
|
|
||||||
- Only logged in users can execute functions (for guests, use anonymous login)
|
- Only logged in users can execute functions (for guests, use anonymous login)
|
||||||
|
|
|
@ -27,7 +27,7 @@ return [
|
||||||
'name' => '_APP_OPTIONS_FORCE_HTTPS',
|
'name' => '_APP_OPTIONS_FORCE_HTTPS',
|
||||||
'description' => 'Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'disabled\'. To enable, set to \'enabled\'. This feature will work only when your ports are set to default 80 and 443.',
|
'description' => 'Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'disabled\'. To enable, set to \'enabled\'. This feature will work only when your ports are set to default 80 and 443.',
|
||||||
'introduction' => '',
|
'introduction' => '',
|
||||||
'default' => 'enabled',
|
'default' => 'disabled',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'question' => '',
|
'question' => '',
|
||||||
],
|
],
|
||||||
|
|
|
@ -23,6 +23,21 @@ void main() async {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error handling
|
||||||
|
The Appwrite Dart SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Users users = Users(client);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’);
|
||||||
|
print(response.data);
|
||||||
|
} on AppwriteException catch(e) {
|
||||||
|
//show message to user or do other operation based on error as required
|
||||||
|
print(e.message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -52,6 +52,19 @@ promise.then(function (response) {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite Deno SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
let users = new sdk.Users(client);
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await users.create('email@example.com', 'password');
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e.message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -28,6 +28,21 @@ static async Task Main(string[] args)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite .NET SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
var users = Users(client);
|
||||||
|
|
||||||
|
try {
|
||||||
|
var request = await users.create('email@example.com', 'password', 'name');
|
||||||
|
var response = await request.Content.ReadAsStringAsync();
|
||||||
|
Console.WriteLine(response);
|
||||||
|
} catch (AppwriteException e) {
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -106,6 +106,21 @@ Response user = await account
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite Flutter SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```dart
|
||||||
|
Users users = Users(client);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’);
|
||||||
|
print(response.data);
|
||||||
|
} on AppwriteException catch(e) {
|
||||||
|
//show message to user or do other operation based on error as required
|
||||||
|
print(e.message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
||||||
|
|
|
@ -52,6 +52,19 @@ promise.then(function (response) {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite Node SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```js
|
||||||
|
let users = new sdk.Users(client);
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await users.create('email@example.com', 'password');
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e.message);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -40,6 +40,19 @@ $users = new Users($client);
|
||||||
$result = $users->create('email@example.com', 'password');
|
$result = $users->create('email@example.com', 'password');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite PHP SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```php
|
||||||
|
$users = new Users($client);
|
||||||
|
try {
|
||||||
|
$result = $users->create('email@example.com', 'password');
|
||||||
|
} catch(AppwriteException $error) {
|
||||||
|
echo $error->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -43,6 +43,17 @@ users = Users(client)
|
||||||
result = users.create('email@example.com', 'password')
|
result = users.create('email@example.com', 'password')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite Python SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```python
|
||||||
|
users = Users(client)
|
||||||
|
try:
|
||||||
|
result = users.create('email@example.com', 'password')
|
||||||
|
except AppwriteException as e:
|
||||||
|
print(e.message)
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
|
@ -41,6 +41,19 @@ users = Appwrite::Users.new(client);
|
||||||
result = users.create(email: 'email@example.com', password: 'password');
|
result = users.create(email: 'email@example.com', password: 'password');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Error Handling
|
||||||
|
The Appwrite Ruby SDK raises `Appwrite::Exception` object with `message`, `code` and `response` properties. You can handle any errors by catching `Appwrite::Exception` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
users = Appwrite::Users.new(client);
|
||||||
|
|
||||||
|
begin
|
||||||
|
result = users.create(email: 'email@example.com', password: 'password');
|
||||||
|
rescue Appwrite::Exception => error
|
||||||
|
puts error.message
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
### Learn more
|
### Learn more
|
||||||
You can use followng resources to learn more and get help
|
You can use followng resources to learn more and get help
|
||||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||||
|
|
61
docs/sdks/web/GETTING_STARTED.md
Normal file
61
docs/sdks/web/GETTING_STARTED.md
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Add your Web Platform
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Init your SDK
|
||||||
|
Initialize your SDK code with your project ID which can be found in your project settings page.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Init your Web SDK
|
||||||
|
const appwrite = new Appwrite();
|
||||||
|
|
||||||
|
appwrite
|
||||||
|
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
|
||||||
|
.setProject('455x34dfkj') // Your project ID
|
||||||
|
;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Make Your First Request
|
||||||
|
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 section.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Register User
|
||||||
|
appwrite
|
||||||
|
.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();
|
||||||
|
|
||||||
|
appwrite
|
||||||
|
.setEndpoint('http://localhost/v1') // Your Appwrite Endpoint
|
||||||
|
.setProject('455x34dfkj')
|
||||||
|
;
|
||||||
|
|
||||||
|
// Register User
|
||||||
|
appwrite
|
||||||
|
.account.create('me@example.com', 'password', 'Jane Doe')
|
||||||
|
.then(function (response) {
|
||||||
|
console.log(response);
|
||||||
|
}, function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Learn more
|
||||||
|
You can use followng resources to learn more and get help
|
||||||
|
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
|
||||||
|
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||||
|
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||||
|
- 🚂 [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter)
|
Loading…
Reference in a new issue