# Web Component

## Installation

To install the package, use the following command:

```bash
npm i @engineai-dev/web-component
```

Alternatively, you can import the `UMD/ESM` bundle directly as a script tag.

## Usage

To use the package, add the following code to your HTML file:

```html
<engineai-web-component
    src="https://example.engineai.com"
></engineai-web-component>
```

## Properties

The following properties are available:

### `src`

URL of the EngineAI platform to load.

### `token`

Valid authentication token to use when loading the EngineAI platform.

### `options`

Json configuration to use when loading the EngineAI platform.

### `resizable`

Can be set to `"false"`. This way, we can force the embed app to be responsive to the container, otherwise the embed app will resize based on the dashboard size.

## Events

The following events are available:

### `state-change`

This event is triggered when the EngineAI platform changes state. The event's detail property contains the platform's event type and the associated data.

# Notes

Version 1.0.0, 1.0.1, 1.1.0 were wrongly versioned in the past, so the 0.X.0 are actually more updated and 2.0.0 is the new starting point.
