Skip to main content
SofIA SDK is a web component that provides medical AI capabilities through an intuitive conversational interface. This guide will help you integrate SofIA SDK into your web application in just a few minutes.

Before you begin

Technical requirements

  • Web application that supports web components or modern JavaScript
  • HTTPS connection (TLS required for audio functionalities)
  • Omniloy API credentials

Getting credentials

Contact support@omniloy.com to obtain:
  • API Key: Authentication key
  • Base URL: API endpoint
  • WebSocket URL: URL for real-time connections

Installation

npm install @omniloy/sofia-sdk
// In your main file (main.js, app.js, etc.)
import '@omniloy/sofia-sdk';

Option 2: CDN

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

Option 3: Manual build

If you already have the package installed via npm, include the script in your build process:
<script src="/dist/webcomponents.umd.js"></script>

Basic configuration

1. Integrate the component

<sofia-sdk
  baseurl="https://api.example.com/v1"
  wssurl="wss://ws.example.com"
  apikey="sk-your-api-key-here"
  userid="user_12345"
  patientid="patient_67890"
  isopen="true"
  toolsargs='{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "clinical_notes",
    "type": "object",
    "required": ["diagnosis"],
    "properties": {
      "diagnosis": {"type": "string", "description": "Medical diagnosis"}
    }
  }'
></sofia-sdk>

2. Configure callbacks

const sofiaComponent = document.querySelector('sofia-sdk');

// Handle generated reports
sofiaComponent.handleReport = (report) => {
  console.log('Medical report generated:', report);
  // Integrate with your medical records system
  saveToEHR(report);
};

// Control component visibility
sofiaComponent.setIsOpen = (isOpen) => {
  console.log('Component status:', isOpen ? 'Open' : 'Closed');
};

Verify the integration

  1. Load the page: SofIA SDK should appear as a floating button
  2. Open the component: Click to expand the interface
  3. Test functionality: Use the microphone to interact
  4. Verify callbacks: Confirm that reports are received correctly

Next steps

Support

Need help? Contact our team: