An About Window in Electron: App Version, Support and Links
Show your app's version and the links your users or support team need in an Electron About window. A practical guide with code examples.
Live example
This is the About box of AboutTheApp itself. Switch the variant to see other layouts. The code below renders exactly this box. For your own app, change the alias.
<script src="https://aboutthe.app/embed/web/0.3.8/card.js" integrity="sha384-xbrze16qslpxxqa0btKjJLhz6NtQVPTbAnS/0lQyyJKYHxPSqH7fyP3zv9aX6kc2" crossorigin="anonymous" async></script>
<about-the-app alias="aboutthe.app" variant="card" api-base="https://aboutthe.app/api/v1" visual-style="default" palette="default" appearance="auto"></about-the-app>What users should find in an About window
Start with the name and version of the app that is currently running. When a user sends the version to support along with a description of the problem, the team can check whether the issue affects that release.
Add links that help users take the next step: documentation, a support contact or a place to report bugs. Depending on the app, release notes, the project website, author details and third-party licenses may also be useful. See the guide to what belongs on an About screen for more examples.
When to use the built-in panel or a custom dialog
Electron's built-in panel may be enough for basic information. Use app.setAboutPanelOptions to set values such as the app name, app version and copyright. Some additional options vary by operating system.
A custom dialog is useful when you want the same layout across platforms, links to help and support, or release notes for a specific version. Since an Electron window displays a web page, you can build that dialog with HTML, CSS and JavaScript.
Make the About window's content easier to maintain
The version must match the running app, but a support or documentation URL can change independently of a release. When designing the window, consider where this information comes from and who will keep it up to date.
One option is AboutTheApp: its ready-made element shows the version supplied by your app alongside managed links, release notes and license details. You can update the links and other managed content without rebuilding the app; the element fetches them when the window's page next loads. The following example shows how to connect it to Electron.
Connect a ready-made About box in 3 steps
The About box runs in the window's page, while the main process knows the app version. A preload script passes the version from one to the other.
- 1
Prepare the information and links
Create a product in AboutTheApp and add links to documentation, support and other places users need to find. Note the product's alias. The Integrate panel on its card provides code with the alias filled in.
- 2
Pass the version from the main process
The main process returns the result of `app.getVersion()` through an IPC handler, and the preload script exposes it to the page.
- 3
Load the script and place the element
Add the script tag to the window's HTML file and put the About box where it should appear, for example in an About dialog or a footer.
Return the version from the main process
`app.getVersion()` returns the `version` from the app's `package.json`. If the file has no version, it returns the version of the current bundle or executable.
const { app, BrowserWindow, ipcMain } = require("electron");
const path = require("path");
ipcMain.handle("app:version", () => app.getVersion());
app.whenReady().then(() => {
const win = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, "preload.js"),
contextIsolation: true,
},
});
win.loadFile("index.html");
});Expose the version in the preload script
The preload script gives the page one function that calls the `app:version` handler. The page gets no direct access to Node.js or `ipcRenderer`.
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("appInfo", {
version: () => ipcRenderer.invoke("app:version"),
});Place the About box and set its version
The page reads the version through `window.appInfo` and sets it in the `version` attribute of the element. The box then shows the version of the running app.
<about-the-app alias="your-alias" variant="dialog"></about-the-app>
<script src="https://aboutthe.app/embed/web/v1/abouttheapp.js" async></script>
<script>
window.appInfo.version().then((version) => {
document.querySelector("about-the-app").setAttribute("version", version);
});
</script>Allow the script and content to load
If your `index.html` sets a Content-Security-Policy meta tag, allow `https://aboutthe.app` in `script-src`, `connect-src` and `img-src`. Otherwise the policy blocks the script or the data it loads.
Check the version when you run from source
When you run the app from source and `package.json` has no `version`, `app.getVersion()` returns the Electron version. Set `version` in `package.json` and the value stays the same in development and in the packaged app.
Frequently asked questions
Can I skip the preload script?
Yes, if your build already knows its version. Pass it as a literal value, for example `version="1.4.2"`, or set it from your build script. You need the preload script only to read the version from the Electron main process at runtime.
Does the About box work with contextIsolation and the sandbox?
Yes. The element runs in the page and loads its content over HTTPS. The preload script exposes only the version function, so the page stays isolated from Node.js.
Why does the About box show a version without release notes?
The version number comes from the app, but the release notes need to be provided separately. In this example, they are loaded from the product's version catalog in AboutTheApp, which needs an entry with the same version. You can also record releases from CI/CD with [GitHub Actions](/integrations/github-actions).
Ready to add your own About box?
Create a free AboutTheApp product and get your integration code right away.