Embedded Intelligence SDK
The AlphaSense Embedded Intelligence SDK allows you to seamlessly integrate AlphaSense's powerful widgets into your web applications. Embed document viewers, generative search capabilities, and other intelligence features directly into your platform.
Overview
The Embedded Intelligence SDK provides a collection of interactive widgets that can be easily integrated into any web application. These widgets leverage AlphaSense's comprehensive data and AI capabilities to deliver intelligent insights directly within your applications.
Available Widgets
- Company Summary - View comprehensive company information
- Company Topics - Company-related topics and themes
- Industry Topics - Industry-specific topics
- Document List - Browse and select documents from collections
- Smart Summary - Generate intelligent document summaries
- Document Viewer - Display and interact with specific documents
- Generative Search - AI-powered chat interface for searching and analyzing content
Quick Start
Installation
Install the SDK using npm:
npm install @alphasense/embedded-widgets
Or use via CDN:
<script src="https://unpkg.com/@alphasense/embedded-widgets@latest/dist/index.min.js"></script>
Basic Usage
import {AlphaSenseWidget} from '@alphasense/embedded-widgets'
const widget = new AlphaSenseWidget({
target: '#widget-container',
widgetType: 'companySummary',
companyParams: {
tickerCode: 'AAPL',
},
width: '100%',
height: '500px',
}).init()
CDN Example
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AlphaSense Widget</title>
</head>
<body>
<div class="container">
<div id="widget"></div>
</div>
<script src="https://unpkg.com/@alphasense/embedded-widgets@latest/dist/index.min.js"></script>
<script>
new AlphaSenseWidget({
target: '#widget',
widgetType: 'companySummary',
companyParams: {
tickerCode: 'AAPL',
},
width: '300px',
height: '500px',
}).init()
</script>
</body>
</html>
Configuration Options
When initializing the AlphaSenseWidget
, you can pass the following options:
Option | Type | Required | Description |
---|---|---|---|
target | string | HTMLElement | No | The target element to render the widget into. Can be a CSS selector string or an HTMLElement. If not provided, a default container will be created. |
widgetType | WidgetType | Yes | The type of widget to render. Available values: 'companySummary', 'companyTopics', 'industryTopics', 'documentList', 'smartSummary', 'documentViewer', 'generativeSearch' |
widgetUrl | string | No | Custom widget backend URL |
generativeSearchParams | object | No | Parameters specific to the Generative Search widget. |
documentViewerParams | object | No | Parameters specific to the Document Viewer widget. Required when widgetType is 'documentViewer'. |
onDocumentClick | function | No | Callback that is called when a document is clicked (e.g., an item in DocumentList or a citation in GenerativeSearch). Receives the document ID as a parameter. When provided, automatically sets documentClickMode to 'docviewer'. |
companyParams | object | No | Parameters specific to the target company identification. See below for details. |
documentClickMode | string | No | Navigation mode for document click handling. Possible values: 'platform' (default), 'docviewer', 'popup'. |
width | string | No | The width of the widget. Defaults to '100%'. |
height | string | No | The height of the widget. Defaults to '100%'. |
generativeSearchParams
The generativeSearchParams
object is optional when using the Generative Search widget:
Parameter | Type | Required | Description |
---|---|---|---|
conversationId | string | No | The conversation ID to continue an existing conversation (e.g., '1234567890__987654321'). |
initialPrompt | string | No | The initial prompt to start a new conversation with (e.g., 'What are the latest Intel results?'). Note: This parameter is ignored when conversationId is provided, as it only works with new conversations. |
documentViewerParams
The documentViewerParams
object is required when using the Document Viewer widget:
Parameter | Type | Required | Description |
---|---|---|---|
docId | string | Yes | The document ID to display in the viewer (e.g., 'doc-12345'). |
companyParams
The companyParams
object can include the following properties:
Parameter | Type | Description |
---|---|---|
tickerCode | string | The ticker code for the company (e.g., 'AAPL', 'NVDA', 'TSLA'). |
Widget Types
The SDK supports the following widget types:
companySummary
- Company overview and key metricscompanyTopics
- Company-related topics and themesindustryTopics
- Industry-specific topicsdocumentList
- Searchable document collectionsdocumentViewer
- Individual document displaysmartSummary
- AI-generated document summariesgenerativeSearch
- Interactive AI search interface
Practical Examples
Document List with Document Viewer Integration
// Document List widget provides onDocumentClick callback
const documentList = new AlphaSenseWidget({
target: '#document-list',
widgetType: 'documentList',
companyParams: {
tickerCode: 'AAPL',
},
onDocumentClick: docId => {
console.log('Document clicked:', docId)
updateDocumentViewer(docId) // Custom handler function
},
width: '300px',
height: '500px',
}).init()
Generative Search Examples
Starting a new conversation with an initial prompt:
new AlphaSenseWidget({
target: '#generative-search',
widgetType: 'generativeSearch',
generativeSearchParams: {
initialPrompt: 'What are the latest Intel results?',
},
width: '100%',
height: '600px',
}).init()
Continuing an existing conversation:
new AlphaSenseWidget({
target: '#generative-search',
widgetType: 'generativeSearch',
generativeSearchParams: {
conversationId: '1234567890__987654321',
},
width: '100%',
height: '600px',
}).init()
Next Steps
- Document Viewer Guide - Learn how to embed document viewing capabilities
- Generative Search Guide - Integrate AI-powered search functionality
- Widget Integration Patterns - Best practices for combining multiple widgets
Support
For technical support and questions about the Embedded Intelligence SDK, please contact apisupport@alphasense.com.