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

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', 'industryTopics', '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 or a citation in GenerativeSearch). 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.
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
  • industryTopics - Industry-specific topics
  • 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()

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@alphasense.com.