npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bcaster/bcaster-lite-widget

v1.0.0

Published

> The BCaster Intelligent Community Camera (ICC) embeddable widget

Downloads

93

Readme

bcaster-lite-widget

The BCaster Intelligent Community Camera (ICC) embeddable widget

Getting Started

The BCaster ICC Widget can be installed/imported via

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

Example Usage

To get the BCaster ICC 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 gotten from the BCaster Dashboard Credentials section.

⚠️ In order for the widget to mount, you are required to have an empty div (if using the default widget) or an anchor tag (if providing your own custom widget) with an id bcaster-widget in your html page. The div or anchor tag should be on the page before the mount function is triggered.

// For default widget
<div id="bcaster-widget"></div>

or

// For a user custom widget - ensure the <a> tag has a blank href attribute
<a id="bcaster-widget" href="">
  // Custom user html
</a>

Embedding via CDN

/* Using the default widget */
<script src="https://unpkg.com/@bcaster/[email protected]/dist/bcaster-lite-widget.js"></script>
<script>
  const widget = new BCasterLiteWidget({
    appId: '7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
  });
  widget.mount();
</script>

or

/* Using a custom defined widget */
<script src="https://unpkg.com/@bcaster/[email protected]/dist/bcaster-lite-widget.js"></script>
<script>
  const widget = new BCasterLiteWidget({
    appId: '7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
    userDefinedWidget: true,
  });
  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

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

or

/* Using a custom defined widget */
const BCasterLiteWidget = require('@bcaster/bcaster-lite-widget')
const widget = new BCasterLiteWidget({
  appId:'7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
  userDefinedWidget: true,
});
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

/* Using the default widget */
import BCasterLiteWidget from '@bcaster/bcaster-lite-widget'

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

or

/* Using a custom defined widget */
import BCasterLiteWidget from '@bcaster/bcaster-lite-widget'

const widget = new BCasterLiteWidget({
  appId:'7ddc01afa5f5e4d10d80eff0d173a8d1e0a3',
  userDefinedWidget: true,
});
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 {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
@param {String} args.accepts (Optional) {Defaults to image} Depicts the mediaType that should be accepted - Permitted values are one of `video`, `image` or `all`.
@param {Boolean} args.userDefinedWidget (Optional) {Default False} A boolean value to determine of the user would prefer to use thier own widget

@example
const widget = new BCasterLiteWidget({
  appId: 'zf7TJ9r',
  mobileView: false,
  mode: 'development',
  lang: 'en',
  tag: 'bcaster',
  accepts: 'image',
  userDefinedWidget: false
})

Supported Languages

Currently the following language options are supported

  • en - English
  • fi - Finnish

Supported Media Types - Accepts

  • image - Allows images only.
  • video - Allows videos only.
  • all - Allows both images and videos.

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 quite slim 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.

Version 0.0.12

  1. Bug fix for tag reference error.

Version 0.0.13

  1. Deprecate labeloption.

Version 0.0.14

  1. Switch codebase to typescript.
  2. Improve custom error messages output.

Version 0.0.15

  1. Introduce optional userDefinedWidget option to enable users define custom widgets.
  2. Add accessibility check to ensure all user defined widgets are wrapped in an anchor tag.
  3. Update documentation examples to show how to use user defined widgets.

Version 0.0.16

  1. Improve build bundle size.
  2. Update documentation.

Version 0.0.17

  1. Added aria-label to widget link in order to conform to accessibility web standards.

Version 0.0.18

  1. Add accepts to configuration initialization options. This provides the possibility to select the prefered media type that should be allowed from the app. It is set to image by default, with the other options being video and all.
  2. Set tag to always default to webapp if a tag is not provided. This ensures consistency in the URL construction.

Version 0.0.19

  1. Switched AppID to be consistent with BCaster shortId.
  2. Remove BCaster defined annonymous ID from widget.
  3. Update App URL to point to new APP endpoint.

Version 1.0.0

  1. Bump version to major stable version.
  2. Update functionality for mobile view with user defined widget.