DevelopersDocumentation

WifiManager — Socket.IO transport (real-time)

Keon WiFi SDK → WifiManager

WifiManager controls a device over a persistent Socket.IO connection opened directly to the FeelExchangeCenter (FEC) server: commands reach the device in near real time and status is pushed back with low latency. Choose this transport when live, interactive control is required.

When to choose it

For the simplest one-key setup see FugManager.

Authentication

The WiFi transport needs a registrationToken, obtained with the partner token:

import { getTokenForKeonWiFi } from '@feelrobotics/keon-wifi-sdk';

const { registrationToken, deviceConnectionKey } = await getTokenForKeonWiFi(
  partnerToken,          // feelAppsToken from your backend (Control Plane)
  deviceConnectionKey    // optional: pass the FeelConnect key to target a device
);

getTokenForKeonWiFi throws AuthError on failure. The registration token is a JWT that also encodes which WebSocket server to connect to.

Quick start

import { getTokenForKeonWiFi, WifiManager } from '@feelrobotics/keon-wifi-sdk';

const { registrationToken } = await getTokenForKeonWiFi(
  partnerToken,
  deviceConnectionKey
);

const manager = await WifiManager.connect(partnerToken, registrationToken, {
  // A connection can cover several devices, so status arrives as a list.
  onStatusChange: (statuses) =>
    console.log('battery', statuses[0]?.battery_status),
  onUserAction: (message) => console.log('user action', message),
});
await manager.moveTo(50, 90);
await manager.disconnect();

API

WifiManager.connect(feelAppsToken, registrationToken, callbacks?) returns a RemoteController — the same server-backed interface as FugManager (getStatuses, setIntensity, setStatusInterval, switchToBtMode, resetCredentials, forceStatusReport), on top of the common KeonController interface.

callbacks accepts onStatusChange(statuses) and onUserAction(message).

Notes


← FugManager — REST · Next: BleManager — Web Bluetooth