Skip to main content
This guide shows how to integrate SofIA SDK in React applications using the <Omniscribe> component.

Initial setup

1. Installation

2. Import in your application

Basic React component

Implementation with hooks

Props

Required

Report generation (required together)

Optional

Callbacks

Retrieving the last report

The setGetLastReport callback receives an async function that you can store and call later:
Pass debug={true} to the <Omniscribe> component to enable verbose console logging. This is helpful during development to trace SDK lifecycle events, connection status, and configuration validation.

Patient data updates

Use React state to dynamically update patient context. The SDK automatically re-initializes when patientid or userid change.

Patient data structure

extraData fields

Full example

See Patient Data for the complete data structure reference.

State management with context

For applications that need to share SofIA state across multiple components:

Complete example

For a complete implementation with React and TypeScript, check our examples repository: View complete React example The example includes:
  • Complete setup with Vite + React 19 + TypeScript
  • Development console with real-time controls
  • Template and patient data editors with JSON validation
  • Dynamic User ID, Patient ID, and Template ID switching

Best practices

Performance

  • Use useCallback for stable callbacks (handleReport, setGetLastReport)
  • Implement lazy loading for components on non-critical routes

State

  • Pass setIsOpen directly — the SDK controls visibility
  • Changing userid or patientid automatically remounts the SDK

Error boundaries

For a complete list of error messages and their resolution steps, see the Error Reference.
Never expose your apikey in client code in production. Use a backend proxy to inject the API key server-side. See the Installation guide for details.

Next steps

  1. JavaScript integration
  2. Angular integration
  3. Required properties reference
  4. Optional properties reference