@alphasense/widgets
v0.1.2
Published
The AlphaSense Widget SDK allows you to easily integrate AlphaSense widgets into your web applications.
Downloads
16
Readme
AlphaSense Widget SDK
The AlphaSense Widget SDK allows you to easily integrate AlphaSense widgets into your web applications.
Installation
You can install the AlphaSense Widget SDK using npm:
npm install @alphasense/widgets
Alternatively, you can use the SDK via a CDN:
<script src="https://unpkg.com/@alphasense/widgets@latest/dist/index.js" type="module"></script>
You can change the version in the URL to the version you want to use.
e.g
<script src="https://unpkg.com/@alphasense/[email protected]/dist/index.js" type="module"></script>
Quick Start
Install the SDK using one of the methods above.
Import and initialize the SDK in your project:
import { AlphaSenseWidget } from '@alphasense/widgets';
const widget = new AlphaSenseWidget({
// Configuration options
});
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 SDK</title>
</head>
<body>
<div class="container">
<div id="widget"></div>
</div>
<script src="https://unpkg.com/@alphasense/widgets@latest/dist/index.js" type="module"></script>
<script type="module">
new AlphaSenseWidget({
target: '#widget',
widgetType: 'companySummary',
useIframe: true,
width: '300px',
height: '500px',
authToken: 'test-token',
widgetUrl: 'https://api.wo-cloud.com/content/widget/?geoObjectKey=6112695&language=en®ion=US&timeFormat=HH:mm&windUnit=mph&systemOfMeasurement=imperial&temperatureUnit=fahrenheit',
onInit: () => {
console.log('Widget initialized');
},
}).init();
</script>
</body>
</html>
Contributing
Check out the development guide to get started.
License
This project is licensed under the AlphaSense License. See the LICENSE file for more details.