Welcome to the BrightSign Dev Cookbook! Here you will find example code and projects for your BrightSign digital signage devices that demonstrate various capabilities.
Whether you're a beginner eager to dive into BrightSign development, or an advanced developer looking to expand your skills, this cookbook offers a wide range of examples to demonstrate the capabilities of these devices.
- Installation
- Using this resource locally
- Examples
- Templates
- Project structure
- Contributing
- Building on M1 Mac
- Support
- License
To use the examples and templates in this repository, you'll need to clone the repository and navigate to the relevant directory.
git clone https://github.com/brightsign/dev-cookbook.git
cd dev-cookbookTo use this repository locally, use the git clone functionality. To do this, click the green <> Code button in the top right and copy the HTTP or SSH URL to your clipboard. Then, in your terminal or command line, run the following:
git clone https://github.com/brightsign/dev-cookbook.gitThe examples in this repository are designed to help you get started with developing on a BrightSign player. These examples serve as stepping stones, allowing you to build and expand your understanding of the platform.
If you've never worked with a BrightSign before, we recommend starting with the HTML starter example.
After this, we recommend integrating Node.js into the application on the BrightSign player. An example of this can be found in node-simple-server.
Once this seems familiar, explore more advanced examples like the self-updater or provisioning server to learn about deployment and fleet management.
From here, we recommend using one of the templates to start developing your own project!
The templates in this repository are starter projects that you can use to begin development on top of existing setups. These templates are designed to provide a solid foundation, allowing you to hit the ground running with your BrightSign projects.
The templates in this repository are intended for developers who are familiar with Node.js, React, and running scripts that connect to devices over a local network.
We recommend managing your Node.js version using nvm. BrightSign devices ship with different Node.js versions depending on the OS:
- BrightSign OS 8.x: Node.js
14.17.6 - BrightSign OS 9.x: Node.js
18
Each Node.js example includes an .nvmrc file. Run nvm use in the example directory to automatically switch to the correct version. See the examples README for a full compatibility matrix.
Here's an overview of the project structure and what each part is responsible for:
templates/: React templates for new projects with custom configurations tailored for BrightSign development.examples/: A collection of examples organized by runtime:browser/(HTML/BrightScript),node-14/(OS 8.x), andnode-18/(OS 9.x)..github/: Contains GitHub Actions configurations for automated build and deployment processes.scripts/: Utility scripts to facilitate build, deployment, and development workflows..eslintrc: Lint configuration to ensure code quality and consistency across the project.package.json: Manages project dependencies and scripts for an efficient development workflow.
This monorepo uses yarn workspaces to manage dependencies and run commands. Simply run yarn install from the workspace root and explore the examples!
To run the tests for every example, run yarn workspaces run test or the shortcut yarn test.
We welcome contributions to the BrightSign Dev Cookbook! Please see our Contributing Guidelines for more information.
Feel free to open an issue or submit a PR; see CONTRIBUTING.MD for further information.
When using Node 14.17.6 on Apple Silicon, you might see an error like npm ERR! Error: Cannot find module 'node-bin-darwin-arm64/package.json'
Run the following commands:
> node -v
v14.17.6
> node -p process.arch
arm64
> arch -x86_64 zsh
> nvm uninstall 14.17.6 && nvm install 14.17.6You might need to do this each time you restart your terminal. This issue does not affect Node 18+.
For more details, see this Stack Overflow thread.
If you have any questions or need help, please open an issue on this repository or contact BrightSign support.
This project is licensed under the MIT License. See the LICENSE file for details.
