Skip to content

useConsoleClient

useConsoleClient(): ConsoleClient

Defined in: console-sdk/src/react/hooks/useConsoleClient.ts:43

The provider’s imperative ConsoleClient (SDK_PLAN.md §3.6.10): client.devices.list(query?) / .get(id) are point-in-time snapshot reads, and .connect / .disconnect / .forget / .controls(id) are the rejecting device commands. The returned object is stable for the provider’s lifetime. Throws OutsideProviderError ('sdk/outside-provider') when no <ConsoleProvider> is above the caller — imperative callers get an exception, matching the client’s own rejecting semantics.

The session surface (current/start/end) lands with M3’s session engine; M2 ships the devices surface.

ConsoleClient

the current provider’s ConsoleClient.

const client = useConsoleClient();
const rowers = client.devices.list({ modality: 'rower', connected: true });
const device = await client.devices.connect({ consoleId: '400123' });