pnpm i @overlayed/app @overlayed/electron --save-exact
pnpm i -g @overlayed/cli
2
Authenticate with Overlayed
Before starting development, authenticate with the Overlayed platform:
overlayed login
You’ll need access to the Overlayed Dashboard. You can apply for access here
3
Create and configure the app
We’ll set up a basic keybind, so we can use it later on to toggle the window.
import { overlayed } from "@overlayed/app";import * as Siege from "@overlayed/app/siege";import electron from "electron";export const overlay = overlayed({ electron, applicationId: "APPLICATION_ID_GOES_HERE", // You'll receive this from the Overlayed Dashboard modules: [Siege.module()], keybinds: { toggleMainWindow: { keys: ["AltLeft", "KeyX"], mode: "toggle", }, },});
4
Initialize your project
Initialize your project with the Overlayed CLI:
overlayed init
This will create an .overlayed directory with your application metadata. More details here.
5
Setup our in-game window
We’ll need to create a window using the Overlayed API since we want it to render in-game.
import { overlay } from "./overlayed.ts";import type { RenderWindow, RenderWindowConstructorOptions } from "@overlayed/app";export class AppWindow { private renderWindow: RenderWindow | null = null; public create(options?: RenderWindowConstructorOptions) { this.renderWindow = overlay.windows.createInGameWindow(options); // Load your site - local dev server in dev, deployed site in production if (import.meta.env.DEV) { // Point this to your local dev server this.renderWindow.loadURL("http://localhost:5173"); } else { const siteUrl = overlay.windows.getProductionSiteUrl(); this.renderWindow.loadURL(siteUrl.toString()); } }}
6
Setup the window hotkey listener
We can listen to the keybind we created in the first step to toggle the window’s visibility.