Goal Make a simple website to start and stop a Handy using the Javascript SDK
Completion time 10min
Skills needed Minimal HTML+Javascript skills

https://youtu.be/lzLSza9Yu8k

Intro

The Handy SDK simplifies the use of the Handy API v2 . The state management is handled. All you need is to tell it what you want to do.

Full documentation of the Handy SDK can be found on npm:

@ohdoki/handy-sdk

<aside> 💁🏿 We will not focus on error handling and good code here. Just as simple as possible to make it work.

</aside>

We will use the mode Handy Alternate Motion Protocol (HAMP) for this tutorial.

Initialise the project

Create the project

Create a folder and navigate into the folder (and open vscode):

mkdir demo-sdk
cd demo-sdk
code .

Create a file index.html in the folder

Make the website

In index.html and add the following code:

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Demo SDK</title>
</head>

<body>
    <h1>Simple ctrl example</h1>
    <button id="start-button">Start</button>
    <button id="stop-button">Stop</button>
</body>
</html>

<aside> 💡 Tips for vscode users: Type doc to get a boilerplate website.

</aside>

Add click listeners