React
The stable frameworks/react subpath supplies gateway context bindings. See the compile-checked React gateway example. Pass authentication from your application boundary.
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
Referenced examples
Verified example · TSX
React gateway
examples/react-gateway.tsx
@cavi-ai/api-clientv0.16.048214137
import { GatewayClientProvider, useGatewayClientContext } from "@cavi-ai/api-client/frameworks/react";
function ConnectionStatus() {
const { state } = useGatewayClientContext();
return <span>{state}</span>;
}
export function GatewayApp() {
return (
<GatewayClientProvider gatewayBaseUrl="https://gateway.example" authToken={null} clientId="docs-example">
<ConnectionStatus />
</GatewayClientProvider>
);
}
Package imports
Referenced by
Artifact provenance
- Package
- @cavi-ai/api-client@0.16.0
- Release
- v0.16.0
- Commit
482141371d7fdb2dd38f7d6eaa5732aec669385a- Source
examples/react-gateway.tsx- Tarball SHA-256
f8ca0ce45d7bf563b1212c708668a5fe788967b8b7d5dbdc9e119e9e09d60167- Content SHA-256
274cf7e926de9581e270ef9bf6120666e7f0595ddf98b6378d7b9921fcff88d3