0.1.8 • Published 5 years ago

nuvidio-widget-js v0.1.8

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

NuVidio Widget JS

Library to use NuVidio Widget in JS applications

Installation

  1. npm i nuvidio-widget-js

Usage

Import NuVidio Widget Scripts

The first thing you must do is import the widget scripts. This import guarantee that the script will be available when you set a department. The import is done through the method importScripts:

import NuVidioWidget from 'nuvidio-widget-js';

// ...

NuVidioWidget.importScripts();

// ...

Set Department

To use the NuVidio Widget in your application you must have the unique identifier to the department created in your company account. With the identifier you can use the method setDepartment as follow:

import NuVidioWidget from 'nuvidio-widget-js';

// ...

NuVidioWidget.setDepartment('identifier', options);

// ...

You can set some options for the widget as well. This options allows you to change some configurations of the widget. (Type NuVidioWidgetOptions)

In case NuVidio Widget is already added to the page the previous configuration will be overlapped.

Remove NuVidio Widget

Is possible to remove the widget at any time by using the removeWidget method:

import NuVidioWidget from 'nuvidio-widget-js';

// ...

NuVidioWidget.removeWidget();

// ...

Using a custom button

The widget popup can be opened by your own custom button. To use this functionality your button must contain the id or class nuvidio-widget-button. E.g.:

<button id="nuvidio-widget-button" class="any-class-you-want">Widget</button>
<button class="nuvidio-widget-button any-class-you-want">Widget</button>

The model using id is more reliable but can be applied to only 1 button, while a class name can be used in multiple buttons.

API

NuVidioWidgetOptions

PropertyTypeRequiredDefaultDescription
fabButtonbooleanfalseThis options hides the left-bottom fab button used to open the video popup.
fabButtonContentstringFalar agoraDefine the text inside the left-bottom fab button.
openbooleanfalseIf this option is set to true, the widget will open when setDepartment is called.
errorMessagestringdefault messageSet the default message showed to the user when occurs some error in the widget.
clientDataobject-This object is used to pass client's data to the widget. (Type clientData)

clientData

PropertyTypeRequiredDefaultDescription
namestring-Client name.
emailstring-Client email (the email field can be filled with another value as cell phone for exemple).
pushToQueuebooleanfalseThis option defines if the client data will be sent to the queue without client confirmation. If true the client will be pushed to the queue automatically. (name and email fields must be filled)

Contact

Any question or sugestion? You can use the GitHub Issues or send a email to gustavo@nuvidio.com.br.

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago