Socket
Socket
Sign inDemoInstall

@bcaster/bcaster-lite-widget

Package Overview
Dependencies
0
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bcaster/bcaster-lite-widget

> An Embeddable web widget for the Bcaster Lite App


Version published
Weekly downloads
17
decreased by-39.29%
Maintainers
2
Install size
16.0 kB
Created
Weekly downloads
 

Readme

Source

bcaster-lite-widget

An Embeddable web widget for the Bcaster Lite App

Getting Started

The BCaster Lite Widget can be installed/imported via

  • CDN UNPKG
  • CDN JSDELIVR
  • NPM

When imported via CDN, it exposes a global BCasterLiteWidget which accepts configuration arguments

Example Usage

To get the BCaster Lite Widget working, copy any of the following code snippet examples that apply, into your web project and replace the appId value with your unique bcaster lite app Id and the label with your unique default label gotten from the BCaster Dashboard Credentials section.

⚠️ In order for the widget to mount, you are required to have an empty div with an id bcaster-floating-widget in your html page. The div should be on the page before mount event is triggered

<div id="bcaster-floating-widget"></div>

Embedding via CDN

<script src="https://unpkg.com/@bcaster/bcaster-lite-widget@0.0.11/dist/bcaster-lite-widget.js"></script>
<script>
  const widget = new BCasterLiteWidget({
    appId: '7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
    label: 'bcaster'
  });
  widget.mount();
</script>

Embedding via NPM (ES5 and older)

First install the package by running npm install @bcaster/bcaster-lite-widget or yarn add @bcaster/bcaster-lite-widget

const BCasterLiteWidget = require('@bcaster/bcaster-lite-widget')
const widget = new BCasterLiteWidget({
  appId:'7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
  label: 'bcaster'
});
widget.mount();

Embedding via NPM (ES6 and later)

First install the package by running npm install @bcaster/bcaster-lite-widget or yarn add @bcaster/bcaster-lite-widget

import BCasterLiteWidget from '@bcaster/bcaster-lite-widget'

const widget = new BCasterLiteWidget({
  appId:'7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
  label: 'bcaster'
});
widget.mount();

Configuration Options

The Bcaster Lite widget library exposes a default BCasterLiteWidget Javascript class which accepts configuration options in the form of a standard Javascript Object. The configuration options signature are as follows

@param {Object} args Configuration values
@param {String} args.appId (Required) The unique App ID - Retrieved from the BCaster Dashboard
@param {String} args.label (Required) The Unique App Label - Retrieved from the BCaster Dashboard
@param {Boolean} args.mobileView (Optional) {Defaults to true} Mobile view option indicating if widget should be visible only on mobile
@param {String} args.mode (Optional) {Defaults to `production`} Mode option for switching between `development` and `production`. This option allows the possibility to run in a sandbox environment
@param {String} args.lang (Optional) {Defaults to `en`} Language attribute for localization
@param {String} args.tag (Optional) {Defaults to the unique label} Tag defined for media categorization - Retrieved from the BCaster Dashboard

@example
const widget = new BCasterLiteWidget({
  appId: '21823638492719937299768436748628',
  label: 'bcaster',
  mobileView: false,
  mode: 'development',
  lang: 'en',
  tag: 'bcaster',
})

Supported Languages

Currently the following language options are supported

  • en - English
  • fi - Finnish

Caveat

🚨 IMPORTANT CAVEAT 🚨

This web widget programatically triggers a new tab which opens a specific instance of the bcaster web app that is custom to your appId. If you have restrictions/policy on your website that blocks opening new tabs then consider adding https://bcaster.com to your allowList.

We open a new tab and connect to your web app instance via https so the possibilities of it being blocked are about 0.01% however if it so happens that you have such policy even for secure connections then please do consider the above caveat.

CHANGELOG

Version 0.0.1

  1. Bcaster Lite Web App web widget.

Version 0.0.2

  1. Remove obsolete dependencies.

Version 0.0.3

  1. Update documentation for usage.

Version 0.0.4

  1. Add lang option for localization.

Version 0.0.5

  1. Fix bug related to mode configuration option.
  2. Update documentation.

Version 0.0.6

  1. Update minified script to reduce bundle size.

Version 0.0.7

  1. Update documentation to use latest version in example.

Version 0.0.8

  1. Add tag option to enable better media content categorization.
  2. Update unit tests to cover all instantiation scenarios.
  3. Update documentation.

Version 0.0.9

  1. Update documentation to highlight caveat for new tab opening.

Version 0.0.10

  1. Deprecate tag option from configuration options.
  2. Introduce compulsory label option to configuartion options.
  3. Update unit tests to cover new instantiation scenarios.

Version 0.0.11

  1. Re-introduce tag option to enable better media content categorization.

Keywords

FAQs

Last updated on 04 Nov 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc