From b4292eb36619ee6264501152ba4ff69ec5ba2bbf Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 23 Mar 2021 12:51:21 +0100 Subject: [PATCH 01/14] add web getting started --- docs/sdks/web/GETTING_STARTED.md | 82 ++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/sdks/web/GETTING_STARTED.md diff --git a/docs/sdks/web/GETTING_STARTED.md b/docs/sdks/web/GETTING_STARTED.md new file mode 100644 index 000000000..1898bd535 --- /dev/null +++ b/docs/sdks/web/GETTING_STARTED.md @@ -0,0 +1,82 @@ +## Getting Started + +### Add your Flutter 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. + +### Get Appwrite Web SDK +#### NPM +Use Javascript package manager, NPM from your command line to add Appwrite SDK to your project. + +```sh +npm install appwrite +``` + +If you're using a bundler (like Browserify or webpack), you can import the Appwrite module when you need it: + +```sh +import * as Appwrite from "appwrite"; +``` + +#### CDN +To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: + +```html + +``` + +### 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) \ No newline at end of file From 79f9801ec23d52dc117572a1df7c81bf1b8a0412 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 23 Mar 2021 12:51:56 +0100 Subject: [PATCH 02/14] fix typo --- docs/sdks/web/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/web/GETTING_STARTED.md b/docs/sdks/web/GETTING_STARTED.md index 1898bd535..511786b5f 100644 --- a/docs/sdks/web/GETTING_STARTED.md +++ b/docs/sdks/web/GETTING_STARTED.md @@ -1,6 +1,6 @@ ## Getting Started -### Add your Flutter Platform +### 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. From 9c5db441049d18ecef35af869fc68ea8af71d972 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 13:01:14 +0545 Subject: [PATCH 03/14] dart error handling section --- docs/sdks/dart/GETTING_STARTED.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/sdks/dart/GETTING_STARTED.md b/docs/sdks/dart/GETTING_STARTED.md index 7a5e8340d..0a1909ea1 100644 --- a/docs/sdks/dart/GETTING_STARTED.md +++ b/docs/sdks/dart/GETTING_STARTED.md @@ -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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From ca5911b4f1d74886eef2f643a2dacd578830015f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 13:32:06 +0545 Subject: [PATCH 04/14] fix typo --- docs/sdks/dart/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/dart/GETTING_STARTED.md b/docs/sdks/dart/GETTING_STARTED.md index 0a1909ea1..56297a2e5 100644 --- a/docs/sdks/dart/GETTING_STARTED.md +++ b/docs/sdks/dart/GETTING_STARTED.md @@ -24,7 +24,7 @@ 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. +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); From c2608c5629e8c945af74ee157789f5cb7bb2103d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 26 Mar 2021 08:56:32 +0100 Subject: [PATCH 05/14] Update GETTING_STARTED.md --- docs/sdks/web/GETTING_STARTED.md | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/docs/sdks/web/GETTING_STARTED.md b/docs/sdks/web/GETTING_STARTED.md index 511786b5f..c8eee4999 100644 --- a/docs/sdks/web/GETTING_STARTED.md +++ b/docs/sdks/web/GETTING_STARTED.md @@ -5,27 +5,6 @@ For you to init your SDK and interact with Appwrite services you need to add a w 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. -### Get Appwrite Web SDK -#### NPM -Use Javascript package manager, NPM from your command line to add Appwrite SDK to your project. - -```sh -npm install appwrite -``` - -If you're using a bundler (like Browserify or webpack), you can import the Appwrite module when you need it: - -```sh -import * as Appwrite from "appwrite"; -``` - -#### CDN -To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: - -```html - -``` - ### Init your SDK Initialize your SDK code with your project ID which can be found in your project settings page. @@ -79,4 +58,4 @@ 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) \ No newline at end of file +- πŸš‚ [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter) From e25a632cfab5c9e14e62bd34f71f2b0dcbace3b1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 13:41:57 +0545 Subject: [PATCH 06/14] deno error handling --- docs/sdks/deno/GETTING_STARTED.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md index f0b10ed37..bfe40468b 100644 --- a/docs/sdks/deno/GETTING_STARTED.md +++ b/docs/sdks/deno/GETTING_STARTED.md @@ -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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From d52825d13487ee7b643d1d88b1baf49dfdfecb59 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 13:45:50 +0545 Subject: [PATCH 07/14] .net error handling --- docs/sdks/dotnet/GETTING_STARTED.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/sdks/dotnet/GETTING_STARTED.md b/docs/sdks/dotnet/GETTING_STARTED.md index 584d571a1..66dca9ff3 100644 --- a/docs/sdks/dotnet/GETTING_STARTED.md +++ b/docs/sdks/dotnet/GETTING_STARTED.md @@ -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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From d2e04720913067b3d02203395282718084ae1686 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 14:03:49 +0545 Subject: [PATCH 08/14] flutter error handling --- docs/sdks/flutter/GETTING_STARTED.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 9dae492f7..78845f3e1 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter) From 447b21bd7e4840a3de167b471e46017bf86438ca Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 14:05:23 +0545 Subject: [PATCH 09/14] node sdk error handling --- docs/sdks/nodejs/GETTING_STARTED.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/sdks/nodejs/GETTING_STARTED.md b/docs/sdks/nodejs/GETTING_STARTED.md index af2564e21..1053f2814 100644 --- a/docs/sdks/nodejs/GETTING_STARTED.md +++ b/docs/sdks/nodejs/GETTING_STARTED.md @@ -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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From 7db2ad922244caf9cafb014b3d355a4398d51e16 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 14:19:47 +0545 Subject: [PATCH 10/14] php sdk error handling --- docs/sdks/php/GETTING_STARTED.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/sdks/php/GETTING_STARTED.md b/docs/sdks/php/GETTING_STARTED.md index 1fcfa35f6..b92bb90e9 100644 --- a/docs/sdks/php/GETTING_STARTED.md +++ b/docs/sdks/php/GETTING_STARTED.md @@ -40,6 +40,19 @@ $users = new Users($client); $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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From d069e83b7973409f708a965f1e3cc39eaf81470b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 14:22:57 +0545 Subject: [PATCH 11/14] python error handling --- docs/sdks/python/GETTING_STARTED.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/sdks/python/GETTING_STARTED.md b/docs/sdks/python/GETTING_STARTED.md index 6b16fa3a9..b513f01da 100644 --- a/docs/sdks/python/GETTING_STARTED.md +++ b/docs/sdks/python/GETTING_STARTED.md @@ -43,6 +43,17 @@ users = Users(client) 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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From 0e20eaac77d635877a1b8d5e3bc0e91765f5ecfa Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 26 Mar 2021 18:20:18 +0545 Subject: [PATCH 12/14] ruby sdk exception handling section --- docs/sdks/ruby/GETTING_STARTED.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/sdks/ruby/GETTING_STARTED.md b/docs/sdks/ruby/GETTING_STARTED.md index d353ee196..23de47c1a 100644 --- a/docs/sdks/ruby/GETTING_STARTED.md +++ b/docs/sdks/ruby/GETTING_STARTED.md @@ -41,6 +41,19 @@ users = Appwrite::Users.new(client); 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 You can use followng resources to learn more and get help - πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server) From 70e809fa921cf3e7828d70922a1762eff04ccff2 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 28 Mar 2021 15:36:15 +0300 Subject: [PATCH 13/14] Fixed default value for https force option --- app/config/variables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/variables.php b/app/config/variables.php index cd7db9ba6..20b49bd9e 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -27,7 +27,7 @@ return [ '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.', 'introduction' => '', - 'default' => 'enabled', + 'default' => 'disabled', 'required' => false, 'question' => '', ], From 298edef242fcdaf5b13c1cd22fd17ae2b4208acf Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 28 Mar 2021 15:36:59 +0300 Subject: [PATCH 14/14] Updated change log --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 99e480f78..9c4400946 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,13 @@ # Version 0.8.0 (Not Released Yet) +## Features + - Anonymous login +## Bugs + +- Fixed default value for HTTPS force option + # Version 0.7.2 (Not Released Yet) ## Features