Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@enplug/sdk-player
Advanced tools
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. :::
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.
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.
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
Use enplug.appStatus
to manage app's lifecycle.
enplug.appStatus.start()
} - app is readyenplug.appStatus.error()
} - app has errored and cannot be displayedenplug.appStatus.hide()
} - app should be hiddenenplug.appStatus.setCanInterrupt()
} - informs whether the app can be hiddenSee more: enplug.appStatus
Use enplug.assets
to fetch the value of the assets that is to be displayed or the selected theme.
enplug.assets.getNext()
} - fetch the value of the asset that is to be displayedenplug.assets.getTheme()
} - get the currently selected themeSee more: enplug.assets
Use enplug.settings
to fetch the settings of the device and the player.
enplug.settings.all
} - returns all device settingsSee more: enplug
FAQs
Enplug Player SDK
The npm package @enplug/sdk-player receives a total of 19 weekly downloads. As such, @enplug/sdk-player popularity was classified as not popular.
We found that @enplug/sdk-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 33 open source maintainers collaborating on the project.
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.