A sample extension that demonstrates how to leverage the Extensions Configuration Service in tandem with an EBS.
What's in the Sample
The Animal Facts extension demonstrates a simple scenario of storing and retrieving extension configuration data. Specifically, the extension displays animal facts (ie. "Cats are unable to detect sweetness in anything they taste.") to viewers based on the animal type (cat or dog) that the broadcaster has selected when configuring the extension.
You can install
yarn by running:
npm i -g yarn
You can install
dep by running:
brew install dep
First time Usage
The recommended path to using this sample is with the Developer Rig.
First, clone the repository into the folder of your choice.
Next, do the following:
- Change directories to the cloned folder.
yarn installto install all prerequisite packages needed to run the frontend.
yarn certto generate the needed certificates; this allows the frontend and EBS servers to be run over HTTPS.
- Change directories to the
- Open the
.envfile and set your extension
Secret, and the
User IDof the extension owner (likely you).
dep ensureto install all prerequisite packages needed to run the EBS.
go buildto compile the EBS binary.
You can now start the sample from the Developer Rig. In the Project Overview, set the following fields:
- Project Name:
- Front-end Files Location:
- Front-end Host Command:
- Back-end Run Command:
- Project Folder:
The file structure in the template is laid out with the following:
/bin folder holds the cert generation script.
/conf folder holds the generated certs after the cert generation script runs.
/dist holds the final JS files after building.
/public houses the static HTML files used for your code's entrypoint.
This folder houses all source code and relevant files (such as images). Each React class/component is given a folder to house all associated files (such as associated CSS).
Below this folder, the structure is much simpler.
This would be:
components -\App --\App.js --\App.test.js --\App.css -\Authentication --\Authentication.js ...
This folder houses all of the source code for the sample backend.