Skip to main content
SofIA SDK is available as an npm package that can be integrated into modern web projects. Choose the installation method that best fits your development environment.

Installation Methods

This is the recommended option for most projects using modern bundlers like Webpack, Vite, or similar.

Installation with NPM

Installation with Yarn

Import in your project

Once imported, the <sofia-sdk> component will be available globally throughout your application.

Option 2: CDN

Ideal for rapid prototyping, bundler-free development, or integration into legacy systems.

For specific version

Option 3: Manual build

For projects with custom build pipelines that already have the package installed via npm.

Installation Verification

After installation, you can verify that the component is available:

In the browser

Open developer tools and run:
Should show the component definition instead of undefined.

In your HTML

Try adding the basic component:
If installation was successful, you’ll see a message indicating missing required properties.

Compatibility

Supported browsers

  • Chrome: 80+
  • Firefox: 75+
  • Safari: 13+
  • Edge: 80+

Compatible frameworks

  • Vanilla JavaScript: Full compatibility
  • React: Native support for Web Components
  • Angular: CUSTOM_ELEMENTS_SCHEMA required
  • Svelte: Compatible compiler. Svelte works out of the box — no dedicated guide needed. Import the SDK in your component’s <script> tag and use <sofia-sdk> directly in your template.

SSR Frameworks (Next.js, Nuxt)

SofIA SDK is a client-side only Web Component. It relies on browser APIs (customElements, WebSocket, getUserMedia, localStorage) that do not exist in server environments. You must disable server-side rendering for any component that imports the SDK.
Next.js — App Router
Next.js — Pages Router
Nuxt 3 Component template:
Create the plugin file below. The .client suffix ensures Nuxt only loads it in the browser:
plugins/sofia-sdk.client.ts

Environment Requirements

HTTPS Protocol

SofIA SDK requires HTTPS for audio and microphone functionalities:
  • Local development: https://localhost or use tools like local-ssl-proxy
  • Production: Valid SSL certificate mandatory

Content Security Policy (CSP)

If your application uses CSP, add the following directives:

Production Security

The apikey is visible in client-side source code. Since apikey is passed as an HTML attribute, anyone can view it via browser DevTools. For production deployments, use a backend proxy to keep the key server-side, and request IP allowlisting from Omniloy as an additional layer.
Route SDK REST traffic through your own backend so the real API key never reaches the browser. The proxy intercepts requests from the SDK, injects the API key server-side, and forwards them to Omniloy.
Then point the SDK’s baseurl at your proxy. The apikey attribute is still required by the SDK — use a placeholder value since the proxy injects the real key:
Note on endpoint auto-resolution and the proxy. For newer keys the SDK would normally auto-resolve the endpoint. To route REST traffic through your proxy instead, pass an explicit baseurl pointing at the proxy (as shown above) — an explicit baseurl always overrides automatic resolution.
wssurl is deprecated and ignored since v1.0.7. The transcription WebSocket URL is now provided automatically by the settings API — there is no wssurl to proxy. Contact support@omniloy.com if your infrastructure needs to route the transcriber WebSocket traffic; the Omniloy team can advise on the best approach.

IP Allowlisting

As an additional layer of protection, Omniloy can restrict API key usage to specific IP addresses. This is especially useful with a backend proxy, where all traffic originates from your server’s fixed IP. Contact support@omniloy.com to configure IP allowlisting for your production keys.

Common Troubleshooting

Component doesn’t load

  1. Verify the import is in the main file
  2. Confirm there are no errors in the browser console
  3. Check network connectivity if using CDN

CORS errors

  • Ensure your application is served from HTTPS
  • Verify that the baseurl URL is correct (or that your key resolves to the expected endpoint)

Component not defined

Next Steps

Once installation is complete:
  1. Required properties: Configure mandatory parameters
  2. Optional properties: Customize behavior
  3. Clinical data schemas: Define data structure to generate