0.1.2 • Published 11 months ago

@alphasense/widgets v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

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/widgets@1.0.0/dist/index.js" type="module"></script>

Quick Start

  1. Install the SDK using one of the methods above.

  2. 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&region=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.

0.1.2

11 months ago

0.1.1

12 months ago

0.1.0

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago