DevelopersDocumentation

Getting Started

Keon WiFi SDK → Getting Started

The SDK controls already-configured devices. Writing WiFi credentials onto a device (provisioning) is out of scope — the Keon user does that with the FeelConnect app (Google Play · App Store), which produces the Device Connection Key (DCK) your application consumes.

Install

npm install @feelrobotics/keon-wifi-sdk
# React applications can install the hook adapter instead (re-exports the core):
npm install @feelrobotics/keon-wifi-sdk-react @feelrobotics/keon-wifi-sdk react

Requires Node.js ≥ 18 for server-side use. The BLE transport is browser-only.

Token glossary

Token Where it comes from Used for
feelAppsToken (partner token) Requested from ControlPlane by your backend: GET /api/v1/partner/{partner_key}/token — see the Control Plane API docs. Authenticating with the OAuth servers (WiFi / Socket.IO transport).
registrationToken Returned by getTokenForKeonWiFi(feelAppsToken, deviceConnectionKey?). A JWT that also encodes the WebSocket server URL. WiFi (Socket.IO) control credentials.
Device Connection Key (the deviceConnectionKey parameter) Issued by the FeelConnect app during device setup; also returned by getTokenForKeonWiFi. Re-associates the same device across sessions; also the FUG credential.

Choosing a transport

One common KeonController interface, three managers — chosen by connection method:

  1. FugManager — recommended default. REST over the Feel Unified Gateway with just a Device Connection Key and HTTP. No Web Bluetooth, no in-browser OAuth; runs in any browser and in Node/back-end.
  2. WifiManager — for real-time. A direct Socket.IO connection to the FEC server: commands in near real time, status pushed with low latency. Suitable when live, interactive control is required.
  3. BleManager — fallback. Direct Web Bluetooth, browser-only, for local control when a server connection is not an option.

The common KeonController interface

Every manager is constructed with its static async connect() factory and implements:

Method Description
moveTo(speed, position) Move to an absolute position. Both integers 0–100.
movementBetween(speed, min, max) Oscillate between two positions. All integers 0–100.
stop() Stop movement.
getStatus() Primary device KeonDeviceStatus (or null).
disconnect() Tear down the connection.
transport 'ble' \| 'wifi' \| 'fug'.

Errors

All SDK errors extend KeonError: KeonError · AuthError · KeonBLEError.

import { KeonError, AuthError } from '@feelrobotics/keon-wifi-sdk';

try {
  await getTokenForKeonWiFi(partnerToken);
} catch (e) {
  if (e instanceof AuthError) {
    /* auth-specific */
  } else if (e instanceof KeonError) {
    /* any SDK error */
  }
}

Next: FugManager — REST (recommended)