---
title: roElectron
slug: develop/roelectron
createdAt: 2025-07-22T16:29:53.000Z
---

<font color="#0C121D">This BrightScript object allows users to run their own Electron applications on BrightSign players using the player's Electron runtime.</font>

<font color="#0C121D">All BrightSign JavaScript objects are available to use with Electron, and BrightSign mechanisms allow communication between JavaScript (Electron main processes) and BrightScript (BrightSign processes).</font>

:::hint{type="info"}
<font color="#0C121D">This object is only available on Series 5 and 6 players.</font>
:::

## Object Creation

*roElectron* is instantiated with a filename (the Electron app entry point) and optional parameters.

```text
electron = CreateObject("roElectron", "file://sd://main.js", {
    app_name: "MyApp",
    message_port: my_message_port,
    arguments: ["arg1", "arg2"]
})
```

You can also pass an optional `node_arguments` parameter, which provides arguments to the Node.js runtime itself (as opposed to `arguments`, which provides arguments to the Electron application being run):

```text
electron = CreateObject("roElectron", "file://sd://main.js", {
    app_name: "MyApp",
    message_port: my_message_port,
    node_arguments: ["arg"],
    arguments: ["arg1", "arg2"]
})
```

- `app_name`<font color="#01a0af">required</font>: The name of the application, used as the name of its user data directory (*\<root>/.home/.config/\<app\_name>*). It must be a single directory name, so it cannot be empty, `. `or `..`, or contain `/ `or `\`.
- `message_port` <font color="#01a0af">o</font><font color="#01a0af">ptional</font>: Allows communication with JavaScript applications
- `arguments` <font color="#01a0af">o</font><font color="#01a0af">ptional</font>: Passes arguments to the Electron application
- `node_arguments` <font color="#01a0af">o</font><font color="#01a0af">ptional</font>: Passes arguments to the executable before the filename, for example, to enable the remote inspector. `node_arguments` can take multiple arguments.
- `env_vars` <font color="#01a0af">o</font><font color="#01a0af">ptional</font>: Passes environment variables (supplied as an associative array) to the Electron application. Note that environment variable names are case-sensitive, but [roAssociativeArray](https://docs.brightsign.biz/develop/roassociativearray) is case-insensitive by default and the BrightScript literal syntax for associative arrays forces all key names to lower case. To ensure correct behavior, call `SetModeCaseSensitive()` and use the `AddReplace()` method to add variables to the array, or use the following approach:

```text
a = {}
a.SetModeCaseSensitive()
a["KeY"] = 1
a["key"] = 2
print a  ' returns both key and KeY
```

:::hint{type="warning"}
`node_arguments` are arguments that come before the filename, while `arguments` come after the filename.
:::

## PostJsMessage ()

### PostJsMessage(data as AssociativeArray) As Boolean

Posts a collection of key\:value pairs to the BrightScript *MessagePort&#x20;*&#x4A;avaScript class running in the Electron app. This method takes an associative array but doesn't support nested associative arrays. The behavior is identical to roNodeJs.PostJsMessage().

## Events

See [roElectronEvent](https://docs.brightsign.biz/develop/roelectronevent) for information about roElectron events.

## Packaging Electron Apps for roElectron

See [Packaging/Debugging Electron Apps for roElectron](https://docs.brightsign.biz/technical/docs-1395-launching-electron-apps-with-roelectron) for instructions on how to package an Electron App for Linux ARM64 so it can be used with roElectron and roElectronEvent.
