A small surface. A clear contract.
Plugins run inside the overlay sandbox. They subscribe to events, render React fragments, and ship as a single JS bundle. The SDK is intentionally narrow — fewer hooks, fewer surprises.
Installation
Create a new plugin from the template repo.
npm create streamforge-plugin my-plugin
cd my-plugin
npm install
npm run dev # launches the sandbox + hot-reloadsAnatomy of a plugin
Every plugin exports a default object with three fields: metadata, an event subscription map, and a React component to render any visible UI.
import { definePlugin } from "@streamforge/sdk";
export default definePlugin({
meta: {
id: "chatbeat",
name: "ChatBeat",
version: "1.0.0",
author: "halen.dev",
},
events: {
"chat.message": (event, ctx) => {
ctx.emit("chatbeat.update", { text: event.text });
},
},
render: ({ state }) => (
<div className="overlay">
{state.recent.map(m => <span key={m.id}>{m.text}</span>)}
</div>
),
});Event types
Plugins can subscribe to any event the host emits. The full list:
type EventKind =
| "chat.message"
| "alert.follow"
| "alert.subscribe"
| "alert.cheer"
| "alert.raid"
| "channel.live"
| "channel.offline"
| "redemption.created"
| "poll.vote";The sandbox
Plugins run in a sandboxed iframe with a postMessage RPC bridge to the host. They cannot:
- Touch the user's localStorage or cookies
- Make outbound HTTP requests to arbitrary hosts (declare allowed origins in
manifest.json) - Read or persist Twitch tokens
- Listen to events for channels other than the one they're installed on
Manifests are reviewed before the plugin lists in the marketplace. If you need an exception, ask — we'd rather grant it than have you ship a hack around it.
Distribution
Build the plugin and submit the bundle:
npm run build
streamforge submit ./dist/plugin.zipWe review for security and taste, then list it on the marketplace. You keep 90% of every sale.