useFlowstackStatus
Monitor the backend connection status, latency, and connectivity with optional polling.
import { useFlowstackStatus } from 'flowstack-sdk'Backend connection monitoring. Optionally polls the backend on an interval and reports connection state and latency.
Signature
const { status, isConnected, latency, error, checkConnection } = useFlowstackStatus(options)Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
options.pollInterval | number | — | Polling interval in ms (e.g. 30000). |
options.autoPoll | boolean | — | Whether to poll automatically. |
Returns
| Field | Type | Description |
|---|---|---|
status | 'connected' | 'disconnected' | 'checking' | Current connection status. |
isConnected | boolean | Whether the backend is reachable. |
latency | number | null | Round-trip latency in ms. |
error | string | null | Last error message. |
checkConnection | () => Promise<void> | Manually trigger a connection check. |
Examples
Connection monitoring
const {
status, // 'connected' | 'disconnected' | 'checking'
isConnected, // boolean
latency, // number | null (ms)
error, // string | null
checkConnection, // () => Promise<void>
} = useFlowstackStatus({
pollInterval: 30000,
autoPoll: true,
});See also
Source: README.md#useflowstackstatus · Also available in llms-full.txt and registry.json.