Skip to content
ForgeCastDocs

Build plugins

Plugins are small Lua programs that add to ForgeCast. React to chat, filter it, build your own windows and Dashboard boxes, and call other websites.

A plugin is a folder with two files: plugin.json (a name and a list of what the plugin may do) and main.lua (the program). ForgeCast runs it for you, safely, next to the app. If you can write a few lines of code, you can make ForgeCast do something nobody built into it.

What plugins are good for

  • React to what happens in chat: a notification and a sound for a keyword, a counter for new members, a giveaway that picks a winner.
  • Filter chat before anyone sees it: hide links, block people, tidy up shouting.
  • Add your own screens: a window with live numbers, a box on the Dashboard with buttons and inputs, a settings panel on the plugin's own card.
  • Talk to the outside world: post to a Discord webhook when you go live, ask an API for something to show.
  • Keep it: settings and data are saved on your computer between runs.

Plugins read chat and stream numbers from the streams you watch, the same ones the Dashboard shows. They can't post to chat, and they can't touch files or run programs on your computer.

A complete plugin

This is a whole plugin. It shows a notification and plays a sound whenever someone sends a Super Chat:

chats.on(Event.SuperChat, function(chat)
  ui.notify({
    title = chat.author.name .. " sent " .. (chat.amount_text or "a Super Chat"),
    message = chat.text,
    level = "success",
  })
  sounds.play("Coin")
end)

Whoever turns the plugin on sees the three permissions and decides whether to allow them. Nothing outside that list works.

Where to go next

The guides go deeper: Chat and streams, Build an interface, Data, timers and the internet, Testing and debugging and The sandbox and its limits. When it's ready, publish it for other streamers.

Early access

The plugin system is new and still growing. The API has a version number ("api": 1 in plugin.json). New functions are added without changing it; a change that would break existing plugins is the only reason for a new number.

On this page