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.
For the simplest one-key setup see FugManager.
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.
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();
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).
connect() resolves before the socket is actually established; connection and
authorization errors are reported to the console rather than rejecting the
returned promise. Treat the first onStatusChange as the connectivity signal.