Getting started
This section primarily focuses on developers with some previous knowledge of web development. Others can use the Web Editor for Applet in Box for creating applets with minimal previous knowledge.
This section will guide you through creating your first applet, applet development and its deployment on a device. This article focuses only on the "CLI" applets, which are the preferred way of developing applets.
We recommend starting a new applet using our CLI, which sets up the project automatically for you.
First you need to install the sos CLI, log in and set up default organization:
npm install @signageos/cli -g
sos login
sos organization set-default
Automated installation
To create a new applet project run:
sos applet generate
This command will create package.json
with useful scripts for the applet development.
start
- starts a local dev server with a emulator.build
- builds the applet to thedist
folder.upload
- uploads the applet built withbuild
to the Cloud Control.connect
- sets up the applet for debugging on a real device.
Local development
Running the start
command will launch a dev server and an emulator, which will watch source files and automatically reloads the applet if
anything changes.
npm run start
By default the emulator with the applet is on http://localhost:8090
Using the sos
SDK
To make the code simpler and portable between different platforms, all applet may use the sos
SDK which exposes unified API for native
functionality. All calls to the sos
needs to happen after sos.onReady()
is resolved.
import sos from '@signageos/front-applet';
sos.onReady().then(async () => {
// Save the
const { filePath } = await sos.offline.cache.loadOrSaveFile(
'video-1.mp4',
'https://static.signageos.io/assets/video-test-1_e07fc21a7a72e3d33478243bd75d7743.mp4',
);
await sos.video.play(filePath, 0, 0, 1280, 720);
});
Deploy to a device
You will need:
- Access to the Cloud Control (Box)
- Provisioned device
First, the applet needs to be built and uploaded to the Cloud Control. To make sure that the applet will be able to run on older device, you
can use npm run escheck
.
npm run build
npm run upload
This uploads the applet into the default organization and makes it available for deployment to the device.
Follow How to assign Applet to the device via Timings to deploy the applet with CloudControl.