SDK Installation
The UG Labs JavaScript SDK provides an easy way to integrate conversational AI into your web applications.
Requirements
- Node.js 16.0 or higher
- npm or yarn package manager
Installation
Using npm
npm install ug-js-sdk
Using yarn
yarn add ug-js-sdk
Importing the SDK
ES6 Modules (Recommended)
import { ConversationManager } from 'ug-js-sdk';
CommonJS
const { ConversationManager } = require('ug-js-sdk');
Browser Support
The SDK works in all modern browsers that support:
- WebSocket API
- Web Audio API
- MediaRecorder API (for audio input)
Supported browsers:
- Chrome/Edge 88+
- Firefox 85+
- Safari 14.1+
TypeScript Support
The SDK is written in TypeScript and includes full type definitions out of the box.
import { ConversationManager, ConversationConfig } from 'ug-js-sdk';
const config: ConversationConfig = {
apiKey: 'your-api-key',
federatedId: 'user-123'
};
Next Steps
Once installed, check out the Quickstart Guide to start building your first conversational AI application.