Skip to main content
This guide details how to integrate SofIA SDK in Angular applications, including the necessary configuration for using Web Components and implementing callbacks.

Initial setup

1. Package installation

2. Module configuration

Angular requires specific configuration to support Web Components:

3. Standalone components configuration (Angular 15+)

For applications using Standalone Components:

Component implementation

HTML template

SofIA SDK delivers data to your app through property callbacks — assign handleReport, setIsOpen, and setGetLastReport as element properties (via @ViewChild in ngAfterViewInit, shown below). The SDK does not emit handle-report/set-is-open DOM events, so Angular event bindings like (handle-report) will not fire. (The only DOM event the SDK dispatches is sofia:transcriber-url-changed.)

TypeScript component

Retrieving the last report

Use the set-get-last-report callback to access the last generated report for the current patient/user session:
Add debug="true" to the <sofia-sdk> element to enable verbose console logging. This is helpful during development to trace SDK lifecycle events, connection status, and configuration validation.

Patient data updates

Update patient context dynamically by changing the bound properties:
See Patient Data for the complete data structure reference.

Advanced configuration

TypeScript interfaces

For better typing, you can define interfaces for the data:

Angular service

You can encapsulate SofIA logic in a service:

Using the service in component

Important considerations

Change detection

Angular may require manual change detection in some cases:

Component lifecycle

Error handling

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. React integration
  3. Required properties reference
  4. Optional properties reference