open-index/open-npm huggingface dataset:
npm package: @oneboard/widget
Description: OneBoard widget
Author: OneBoard
Latest version: 1.3.2

# `@oneboard/widget`


## Example

```javascript
import OneBoard from '@oneboard/widget';

const oneBoard = new OneBoard({
    appPublicKey: '<AppPublicKey>',
    verificationToken: '<UserVerificationToken>',
  });

oneBoard.openOnBoardingModal();
```

## Installing

```shell
npm install @oneboard/widget
```

Or self-host / CDN

```html
<script src="build/index.js"></script>
```

## Configuration

Specify configuration options when creating a OneBoard instance

##### Example

```javascript
import OneBoard from '@oneboard/widget';

new OneBoard({...options})
```

#### Options

| Option              | Type      | Required  | Desciption                                                                    |
| ------------------- | --------- | --------- | ----------------------------------------------------------------------------- |
| `appPublicKey`      | String    | Yes       |  Public key for your OneBoard application                                     |
| `verificationToken` | String    | No        |  User token for verification request. You van get it from oneboard SDK        |


## API

### openOnBoardingModal([options])

Open OneBoard widget as modal

##### Example

```javascript
oneBoard.openOnBoardingModal({ fullScreen: true });
```

#### Options

- `fullScreen`: (Optional) Lifetime for access token in seconds. Defaults to `false`.




### renderOnBoardingView(container)

Render OneBoard widget view to custom element specified in `container` argument.
- `container` can be CSS selector or DOM Element

##### Example

```html
<div id="oneboard-container"></div>
```

```javascript
oneBoard.renderOnBoardingView('#oneboard-container');
```