This project is a Chrome extension designed to work together with a Node/ExpressJS server. Its main function is to extract the currently playing song's information from the StreamElements Media Request and send it to your local server in real-time, so it can be displayed in a custom overlay.
StreamElements has a feature that allows viewers to request songs during live streams. While they offer their own overlay to display this information, I found its configuration somewhat cumbersome and with very limited customization options. For this reason, I decided to develop my own alternative. While the server handles displaying the information in OBS with total creative freedom, this extension acts as the necessary bridge to read the data directly from the StreamElements Media Request and automatically send it to the server.
The project works as a very lightweight browser extension with the following main features:
- Data Capture: It constantly reads the StreamElements "Media Request" player to get the song title and the user who requested it.
- Real-time Synchronization: Upon detecting a song change, it immediately sends this data via an HTTP request (API) to your server.
- Security: It communicates using a configurable
API_KEYto ensure that only your extension can update your overlay.
Below is the structure and purpose of the main project files:
-
manifest.jsonMain configuration file for the extension. It defines the necessary permissions, thecontent_scriptsinjected into StreamElements, and the service worker that runs in the background. -
config.jsContains the configuration variables for the extension, such as the local server URL and the API key (API_KEY) to secure the communication. -
core/api.jsActs as the background service worker. It listens for internal extension messages when a song changes and handles sending the POST request with the updated data to the server. -
core/RecordPlayer.jsProvides the core logic to monitor the player's state and emit song change events to the extension. -
platforms/StreamElements.jsSpecific script injected into the StreamElements page. It is responsible for parsing the page to extract the current song title and the username of the person who requested it.