Skip to main content
This page walks through controlling device playback from a web browser. Devices and browsers use different protocols and endpoints to reach our system, so we provide a mechanism to remotely control the device. The WebSocket example below shows how to connect, subscribe to scripts or live streams, and start receiving signals on the device.

1. Connect a device to the Haptics server

Follow the First Activation instructions to set up a real device.

2. Subscribe to the Haptics stream

2.1 Start a local web server with the device control example:
2.2 Open a browser and go to localhost:8080. 2.3 Because you are testing the connection locally, you may lack the required authentication cookies. Log in to your account, copy the auth_jwt cookie value from the session, and paste it into the Auth JWT input field. This value is passed to the Haptics server during WebSocket initialization. 2.4 Enter your device name and the desired script or live stream. Available development live stream IDs:
2.5 Click Connect. If everything is correct, you will start receiving signals on your device.
You have connected from your web browser to your device and sent the first command.