Skip to main content
createCorsairReactClient({ baseURL }) returns a bag of typed React hooks built on top of createCorsairClient. One factory call per app — use the returned hooks anywhere in your component tree.
corsair-client.ts
React 18+ is a peer dependency. If you aren’t on React, use the vanilla client.

Read hooks

Read hooks follow the same shape:
tenants-list.tsx
Read hooks re-fetch automatically when their argument changes:
tenant-detail.tsx
Available read hooks: useTenants, useTenant(id), usePlugins, usePlugin(id), useConnectionStatus({ tenantId }), usePermission({ id }) or usePermission({ token }).

Mutation hooks

Mutations stay idle until you call mutate(input):
create-tenant.tsx
Available mutation hooks: useCreateTenant, useCreateConnectLink, useOAuthCallback.

Connection status

useConnectionStatus is the hook your dashboard probably opens with. The response is a Record<string, 'connected' | 'missing_credentials' | 'not_connected'> keyed by plugin id:
connections.tsx
For wiring the actual connect-and-authorize flow, see the Connect page.

Escape hatch

If a hook doesn’t fit (e.g. you need imperative access inside an event handler), reach for client:
escape.tsx
It is exactly the vanilla client, sharing the same baseURL.

What this is not

These hooks are intentionally minimal: no cache, no deduplication, no request reuse. If you want React Query, SWR, or RTK semantics, build them on top of client — the hooks here exist to give you typed loading/error/data state without forcing a data-layer choice.