Install
@okrapdf/sdk/react is a subpath export of the SDK package, not a separate npm package.
OkraProvider
Wrap a subtree with OkraProvider and provide either a documentId, a url, or a file.
Use publishable browser keys or a server-side boundary for browser apps. Do not expose okra_sk_ secret keys in client-side bundles.
Status and pages
Chat
The React package does not ship a separate useStructuredOutput hook. Call session.prompt(...) with a schema from your component or wrap it in your app’s own state hook.
DocumentAgent realtime context
For realtime DocumentAgent state and methods, use createOkraContext(...). This requires the agents React package in your app.