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

@enplug/sdk-player

v0.11.8

Published

Enplug Player SDK

Downloads

152

Readme

Player SDK

The Player SDK is a JavaScript library which provides communication between the app hosted within the Player's iframe with the hosting Player. It allows to fetch the value of the asset which is to be displayed, manage the app's lifecycle, fetch device's settings and others.

:::note Development tips The app using Player SDK has to be run inside of the Player's iframe to function properly as the SDK serves as a transport channel of the messages only. All commands are actually executed by the hosting Player. This means that running your app outside of the Player will not work. To run your app inside of the Player, you need to add it to the system. See Creating an App. After you create a new asset in the Dashboard part of the app and assign it to some Display Group, the app should start appearing in the Player. :::

Installing the Player SDK

Include the Player SDK script in your app, by adding the following code to the <head> section of your app's HTML file:

<script type="text/javascript" src="https://apps.enplug.com/sdk/v1/player.js"></script>

This will create a global enplug/window.enplug object providing various SDK methods for communicating with the hosting Player.

Type support

If you use TypeScript and would like to have the typings checked in your IDE you can load the following NPM package:

npm install @enplug/sdk-player --save-dev

Then, add "@enplug/sdk-player" to the types array in your TypeScript config file. Make sure that typeRoots array has the "node_modules" entry, so that the whole path is available to the compiler.

Usage

After the Player SDK script gets loaded into your app, it will instantly create a global enplug/window.enplug object which gives you the access to the methods provided by the Player.

See more: enplug

Useful APIs

Account API

Use enplug.appStatus to manage app's lifecycle.

  • {@link start|enplug.appStatus.start()} - app is ready
  • {@link error|enplug.appStatus.error()} - app has errored and cannot be displayed
  • {@link hide|enplug.appStatus.hide()} - app should be hidden
  • {@link setCanInterrupt|enplug.appStatus.setCanInterrupt()} - informs whether the app can be hidden

See more: enplug.appStatus

Assets API

Use enplug.assets to fetch the value of the assets that is to be displayed or the selected theme.

  • {@link getNext|enplug.assets.getNext()} - fetch the value of the asset that is to be displayed
  • {@link getTheme|enplug.assets.getTheme()} - get the currently selected theme

See more: enplug.assets

Settings API

Use enplug.settings to fetch the settings of the device and the player.

  • {@link all|enplug.settings.all} - returns all device settings

Others

See more: enplug