Skip to main content
Version: Beta

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
  • 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:

OptionTypeRequiredDescription
targetstring | HTMLElementNoThe 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.
widgetTypeWidgetTypeYesThe type of widget to render. Available values: 'companySummary', 'companyTopics', 'documentList', 'smartSummary', 'documentViewer', 'generativeSearch'
widgetUrlstringNoCustom widget backend URL
generativeSearchParamsobjectNoParameters specific to the Generative Search widget.
documentViewerParamsobjectNoParameters specific to the Document Viewer widget. Required when widgetType is 'documentViewer'.
onDocumentClickfunctionNoCallback that is called when a document is clicked (e.g., an item in DocumentList, a citation in GenerativeSearch, or a citation in CompanyTopics). Receives the document ID as a parameter. When provided, automatically sets documentClickMode to 'docviewer'.
companyParamsobjectNoParameters specific to the target company identification. See below for details.
documentSearchParamsobjectNoParameters for filtering and searching documents in the Document List widget. See "Document List with Search Parameters" section for details.
documentClickModestringNoNavigation mode for document click handling. Possible values: 'platform' (default), 'docviewer', 'popup'.
widthstringNoThe width of the widget. Defaults to '100%'.
heightstringNoThe height of the widget. Defaults to '100%'.

generativeSearchParams

The generativeSearchParams object is optional when using the Generative Search widget:

ParameterTypeRequiredDescription
conversationIdstringNoThe conversation ID to continue an existing conversation (e.g., '1234567890__987654321').
initialPromptstringNoThe 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:

ParameterTypeRequiredDescription
docIdstringYesThe document ID to display in the viewer (e.g., 'doc-12345').

companyParams

The companyParams object can include the following properties:

ParameterTypeDescription
tickerCodestringThe ticker code for the company (e.g., 'AAPL', 'NVDA', 'TSLA').

Widget Types

The SDK supports the following widget types:

  • companySummary - Company overview and key metrics
  • companyTopics - Company-related topics and themes
  • documentList - Searchable document collections
  • documentViewer - Individual document display
  • smartSummary - AI-generated document summaries
  • generativeSearch - 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()

Document List with Search Parameters

The Document List widget supports advanced filtering and search capabilities through documentSearchParams:

// Single company with search filters
new AlphaSenseWidget({
target: '#document-list',
widgetType: 'documentList',
companyParams: {
tickerCode: 'AAPL',
},
documentSearchParams: {
keyword: 'earnings',
documentTypes: ['1', '2'],
primaryOnly: true,
sorting: {
field: 'DATE',
direction: 'DESC',
},
},
width: '100%',
height: '600px',
}).init()

// Multi-company search
new AlphaSenseWidget({
target: '#document-list',
widgetType: 'documentList',
documentSearchParams: {
tickers: ['MSFT', 'AAPL', 'GOOGL'],
keyword: 'revenue',
contentSetIds: ['12001', '77'],
sorting: {
field: 'RELEVANCE',
direction: 'DESC',
},
},
width: '100%',
height: '600px',
}).init()

// Watchlist-based filtering
new AlphaSenseWidget({
target: '#document-list',
widgetType: 'documentList',
documentSearchParams: {
watchlistIds: ['1367044'],
keyword: 'AI trends',
sorting: {
field: 'DATE',
direction: 'DESC',
},
},
width: '100%',
height: '600px',
}).init()

Available Search Parameters

ParameterTypeDescription
keywordstringText search keyword to filter documents
documentTypesstring[]Array of document type IDs for filtering
savedSearchIdstringSaved search ID to load predefined search criteria
watchlistIdsstring[]Array of watchlist IDs to filter documents by watchlists
contentSetIdsstring[]Array of content set IDs to filter by document sources
tickersstring[]Array of ticker codes to filter documents by multiple companies
sortingobjectSort configuration with field ('DATE', 'RELEVANCE', 'SENTIMENT', 'PAGES') and direction ('ASC', 'DESC')
primaryOnlybooleanIf true, only show documents where the company is the primary subject (not just mentioned)

Company Topics with Document Viewer Integration

The Company Topics widget supports onDocumentClick callback for handling citation clicks:

// Company Topics widget with citation click handling
const companyTopics = new AlphaSenseWidget({
target: '#company-topics',
widgetType: 'companyTopics',
companyParams: {
tickerCode: 'AAPL',
},
onDocumentClick: docId => {
console.log('Citation clicked in Company Topics:', docId)
updateDocumentViewer(docId) // Custom handler function
},
width: '100%',
height: '450px',
}).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

Support

For technical support and questions about the Embedded Intelligence SDK, please contact apisupport@alpha-sense.com.