# Nonstop Javascript SDK

## Points Widget

### How to Use

Include via JS:

```javascript
    var pointsWidgetContainer = document.querySelectorAll('.points-widget-wrapper')[0];
    Nonstop.default.presentPointsWidget(pointsWidgetContainer);
```

### Customization

`presentPointsWidget` accepts a second parameter which can be used to configure the look of the points widget. It accepts the following properties:

* **isRightRounded** - (Defaults value: `true`) If set to `false`, this will lead to the right side of the widget not being rounded.
* **isLeftRounded** - (Defaults value: `true`) If set to `false`, this will lead to the left side of the widget not being rounded.
* **dropdownEnabled** - (Defaults value: `true`) Determines whether the widget will display dropdown messages to the user in certain scenarios.

### Events

The points widget emits the following events:

#### GoToNonstopHome

```javascript
    document.addEventListener(Nonstop.default.Events.GoToNonstopHome, function() {
        
    });
```

This event is fired when the points widget is clicked. On receiving this event, the containing app should redirect the user to Nonstop Home.