-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,26 @@ The Flutter SDK includes: | |
- Widgets to ease the development process | ||
- Authentication tools so users can log in securely | ||
|
||
## Example usage | ||
## Install the Flutter SDK | ||
|
||
Run the following command in your terminal to install the Viam Flutter SDK: | ||
|
||
```sh {id="terminal-prompt" class="command-line" data-prompt="$"} | ||
flutter pub add viam_sdk | ||
``` | ||
|
||
## Connect to your machine | ||
|
||
You can find sample connection code on each machine's **CONNECT** tab in the [Viam app](https://app.viam.com). | ||
Select **Flutter** to display a code snippet with connection code as well as some calls to the APIs of the resources you've configured on your machine. | ||
|
||
You can use the toggle to include the machine API key and API key ID, though we strongly recommend storing your API keys in environment variables to reduce the risk of accidentally sharing your API key and granting access to your machines. | ||
|
||
## Write your app | ||
|
||
Refer to the [Viam Flutter SDK](https://flutter.viam.dev/) documentation for available methods and widgets. | ||
|
||
### Example usage | ||
|
||
The following code, part of [Drive a rover in a square in 2 minutes](/how-tos/drive-rover/), shows how you could move a robotic rover base in a square using the base API's [`moveStraight`](https://flutter.viam.dev/viam_sdk/Base/moveStraight.html) and [`spin`](https://flutter.viam.dev/viam_sdk/Base/spin.html) methods: | ||
|
||
|
@@ -66,8 +85,22 @@ For a more in-depth guide with more screens, see the following guide: | |
{{% card link="/tutorials/control/flutter-app/" %}} | ||
{{< /cards >}} | ||
|
||
## Set up authentication | ||
## Test your app | ||
|
||
You can use the mobile app simulator on your development computer to test your app. | ||
The connection code will establish communication with your machine over LAN or WAN. | ||
|
||
## Set up user authentication | ||
|
||
Viam uses [FusionAuth](FusionAuth) for authentication and authorization. | ||
|
||
Use the [Viam CLI `auth-app` command](/dev/tools/cli/#auth-app) to register your application with FusionAuth so that you or your users can log into your app with the same credentials they use to log into the [Viam app](https://app.viam.com). | ||
|
||
For support building apps with custom login flows, [contact us](mailto:[email protected]). | ||
|
||
## Next steps | ||
|
||
To publish your app to the app stores when you're done testing and adding authentication, see Flutter's articles: | ||
|
||
- [iOS](https://docs.flutter.dev/deployment/ios) | ||
- [Android](https://docs.flutter.dev/deployment/android) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,46 @@ The TypeScript SDK includes: | |
- Implementation of the standard component and service APIs to control your hardware and software | ||
- Authentication tools so users can log in securely | ||
|
||
## Example usage | ||
## Install the TypeScript SDK | ||
|
||
Run the following command in your terminal to install the Viam TypeScript SDK: | ||
|
||
```sh {id="terminal-prompt" class="command-line" data-prompt="$"} | ||
npm install @viamrobotics/sdk | ||
``` | ||
|
||
## Connect to your machine | ||
|
||
You can find sample connection code on each machine's **CONNECT** tab in the [Viam app](https://app.viam.com). | ||
Select **TypeScript** to display a code snippet, with connection code as well as some calls to the APIs of the resources you've configured on your machine. | ||
|
||
You can use the toggle to include the machine API key and API key ID, though we strongly recommend storing your API keys in environment variables to reduce the risk of accidentally sharing your API key and granting access to your machines. | ||
|
||
## Write your app | ||
|
||
Refer to the [Viam TypeScript SDK](https://ts.viam.dev/) documentation for available methods. | ||
|
||
### Example usage | ||
|
||
For an example using Vite to connect to a machine, see [Viam's vanilla TypeScript quickstart example on GitHub](https://github.com/viamrobotics/viam-typescript-sdk/tree/main/examples/vanilla). | ||
|
||
The following tutorial uses the Viam TypeScript SDK to query data that has been uploaded to the Viam cloud from a sensor, and display it in a web dashboard. | ||
|
||
{{< cards >}} | ||
{{% card link="/tutorials/control/air-quality-fleet/" %}} | ||
{{< /cards >}} | ||
|
||
## Set up authentication | ||
## Test your app | ||
|
||
You can run your app directly on the machine's single-board computer (SBC) if applicable, or you can run it from a separate computer connected to the internet or to the same local network as your machine's SBC or microcontroller. | ||
The connection code will establish communication with your machine over LAN or WAN. | ||
|
||
You can also host your app on a server or hosting service of your choice. | ||
|
||
## Set up user authentication | ||
|
||
Viam uses [FusionAuth](FusionAuth) for authentication and authorization. | ||
|
||
Use the [Viam CLI `auth-app` command](/dev/tools/cli/#auth-app) to register your application with FusionAuth so that you or your users can log into your app with the same credentials they use to log into the [Viam app](https://app.viam.com). | ||
|
||
For support building apps with custom login flows, [contact us](mailto:[email protected]). |