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

npm install @omniloy/sofia-sdk

Installation with Yarn

yarn add @omniloy/sofia-sdk

Import in your project

// In your main file (main.js, app.js, index.js, etc.)
import '@omniloy/sofia-sdk';
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.
<script src="https://unpkg.com/@omniloy/sofia-sdk@latest/dist/webcomponents.umd.js"></script>

For specific version

<script src="https://unpkg.com/@omniloy/sofia-sdk@1.0.0/dist/webcomponents.umd.js"></script>

Option 3: Manual build

For projects with custom build pipelines that already have the package installed via npm.
<script src="/dist/webcomponents.umd.js"></script>

Installation Verification

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

In the browser

Open developer tools and run:
console.log(customElements.get('sofia-sdk'));
Should show the component definition instead of undefined.

In your HTML

Try adding the basic component:
<sofia-sdk></sofia-sdk>
If installation was successful, you’ll see a message indicating missing required properties.

Compatibility

Supported browsers

  • Chrome: 54+
  • Firefox: 63+
  • Safari: 10.1+
  • Edge: 79+

Compatible frameworks

  • Vanilla JavaScript: Full compatibility
  • React: Native support for Web Components
  • Angular: CUSTOM_ELEMENTS_SCHEMA required
  • Vue.js: Additional configuration needed
  • Svelte: Compatible compiler

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:
connect-src 'self' https://*.omniloy.com wss://*.omniloy.com;
script-src 'self' 'unsafe-inline' https://unpkg.com;

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 baseUrl and wssUrl URLs are correct

Component not defined

// Wait for the component to be defined
customElements.whenDefined('sofia-sdk').then(() => {
  console.log('SofIA SDK is ready');
});

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