Edge Apps Overview

This section provides an overview of Edge Apps and their implementation within the Screenly repository.

What are Edge Apps?

Edge Apps are small, self-contained applications that run on Screenly devices and extend the functionality of the platform. They are typically written in JavaScript and interact with the Screenly API to access data and control the display.

Implementation

Edge Apps are implemented as JavaScript files that are loaded into the browser running on the Screenly device. The JavaScript code can interact with the Screenly API using a set of JavaScript functions and objects.

Examples of Edge Apps

The Screenly repository includes several examples of Edge Apps, demonstrating various functionalities:

Asset Metadata

  • Provides metadata about the displayed asset, such as filename, size, and creation date.

Clock App

  • Displays a simple digital clock.

Power BI

  • Integrates Power BI reports into a Screenly display.

QR Code Generator

  • Generates QR codes that can be scanned by mobile devices.

RSS Reader

  • Displays content from RSS feeds.

Weather App

  • Displays current weather information.

iFrame App

  • Embeds an external website into a Screenly display.

Countdown Timer

  • Displays a countdown timer.

Simple Message App

  • Displays a simple text message.

Accessing the Screenly API

Edge Apps interact with the Screenly API through a set of JavaScript functions and objects. These functions allow Edge Apps to:

  • Get information about the current display
  • Control the display, such as switching between assets or controlling the volume
  • Access data from external sources

Example:

// Get the current screen's name
          Screenly.Screen.getName().then(screenName => {
            console.log("Screen name:", screenName);
          });
          
          // Set the background color of the display
          Screenly.Screen.setBackgroundColor("#FF0000").then(() => {
            console.log("Background color changed to red.");
          });
          

Creating an Edge App

To create an Edge App, you can follow these steps:

  1. Create a JavaScript file.
  2. Include the Screenly API library.
  3. Write JavaScript code that interacts with the Screenly API.
  4. Deploy the JavaScript file to the Screenly device.

Example:

// Include the Screenly API library
          const Screenly = window.Screenly;
          
          // Create a simple message app
          Screenly.Screen.showText("Hello, world!").then(() => {
            console.log("Message displayed.");
          });
          

Finding More Information

For more information about Edge Apps and the Screenly API, please refer to the Screenly documentation.