Screenly is an open-source digital signage platform that allows users to create, manage, and deploy content on various displays. One of the ways to extend Screenly’s functionality is by using Chrome extensions. In this guide, we will focus on deploying and installing a Chrome extension using Screenly and the screenly-chrome-extension
library.
Prerequisites
Before proceeding with the deployment and installation process, ensure you have the following prerequisites in place:
- A Screenly account: Sign up for a Screenly account if you don’t already have one. You can create an account here.
- A Screenly Player: Install a Screenly Player on the device where you want to run the Chrome extension. You can download the Screenly Player here.
- Node.js: Install Node.js on your development machine to manage the project dependencies and build the Chrome extension. You can download Node.js here.
- Git: Install Git on your development machine to clone the
screenly-chrome-extension
repository. You can download Git here. - Google Chrome: Install Google Chrome on the development machine and the device where you want to run the Chrome extension.
Setting up the Project
- Clone the
screenly-chrome-extension
repository: Open a terminal or command prompt and run the following command to clone thescreenly-chrome-extension
repository:
git clone https://github.com/screenlyapp/screenly-chrome-extension.git
- Navigate to the project directory: Change the current working directory to the
screenly-chrome-extension
directory:
cd screenly-chrome-extension
- Install project dependencies: Run the following command to install the project dependencies:
npm install
Creating the Chrome Extension
- Create a new Chrome extension: Create a new directory for your Chrome extension inside the
extensions
folder:
mkdir my-chrome-extension
cd my-chrome-extension
- Initialize the Chrome extension: Run the following command to initialize a new Chrome extension:
npx create-react-app . --template @screenly/chrome-extension
This command will create a new React project with the necessary files and configurations for a Chrome extension.
- Modify the Chrome extension: You can now modify the files inside the
my-chrome-extension
directory to create your custom Chrome extension.
Building the Chrome Extension
- Build the Chrome extension: Navigate back to the
screenly-chrome-extension
directory and run the following command to build your Chrome extension:
npm run build:chrome
This command will build the Chrome extension and generate the necessary files in the build/chrome
directory.
Installing the Chrome Extension on the Development Machine
Load the Chrome extension: Open Google Chrome and load the unpacked extension by navigating to
chrome://extensions
and clicking on the “Load unpacked” button. Select thebuild/chrome
directory.Test the Chrome extension: You can now test your Chrome extension inside Google Chrome on your development machine.
Deploying the Chrome Extension to Screenly Player
- Prepare the Chrome extension for deployment: Navigate back to the
screenly-chrome-extension
directory and run the following command to prepare the Chrome extension for deployment:
npm run package:chrome
This command will package the Chrome extension and generate the necessary files in the dist/chrome
directory.
Upload the Chrome extension to Screenly: Log in to your Screenly account, go to the “Extensions” tab, and click on “Add Extension”. Upload the
manifest.json
file from thedist/chrome
directory.Install the Chrome extension on the Screenly Player: Go to the “Displays” tab, select the display where you want to run the Chrome extension, and click on “Add Content”. Select the
dist/chrome
directory as the content source.Test the Chrome extension: The Chrome extension should now be installed and running on the Screenly Player. You can check the status of the Chrome extension in the “Extensions” tab of the Screenly dashboard.
For more information about Screenly, Chrome extensions, and the screenly-chrome-extension
library, please refer to the following resources: