You can build additional interfaces that are hosted with any add-ons, extensions, or 3rd party sites. Each action is a single URL that will be loaded and displayed when a user presses a button on the Owncast page.External actions was first supported in Owncast 0.0.7.
Some examples of this functionality might be things like:
- A leader board for some chat-based game you built or an external game you’re playing on stream.
- Lists of actions that perform fun animations on your stream overlays when selected.
- Integrations with your polling chat bot that shows recent polls and the results.
- Tip Jar to accept donations.
- A schedule that is fancier or more interactive than what you can represent in Markdown.
- External actions must be hosted on a server that supports SSL and has a
httpsprotocol. Unsecured URLs are not supported.
- These URLs must support existing inside an iframe. This means X-FRAME-OPTIONS and the CSP cannot be blocking. If you are blocked then you’re limited to loading this URL in a new tab and that’s not a great experience.
- While you can experiment with using URLs that you don’t personally control, it’s often likely that many of them will not work due to limitations placed on the remote server. An example of this is just throwing in a PayPal or Google URL.
How to register actions
- Visit the admin, and under “Integrations” go to the “External Actions” page.
- Add an action.
- Put the URL of this action. It should be a HTTPS destination and follow the best practices listed.
- Give it a name that will be displayed on the button that launches this action, an optional description that will show in the modal that presents the action, a URL to an optional icon for the button, and optionally a color that will be used for the button.
- If you really want to register a URL you don’t control, but it doesn’t work with the default functionality, you can tell it to “Open Externally” and it will open a new tab in your browser. This is not optimal, but it’s an option.
- This action’s UI should perform little to no navigation. It shouldn’t be treated as a way to show just any page.
- Design your UI to live in a small window that doesn’t require much, if any, scrolling, and is responsive to mobile and small displays.
- Make sure your URL’s server allows loading your content from your Owncast server via X-FRAME-OPTIONS and the CSP.
- The chat username of the person who fired this action is passed along as a URL parameter so you can pre-fill any forms for convenience. You should utilize this.
- The instance URL of the Owncast server that is displaying this action UI is passed along as a URL parameter so if you happen to be hosting actions for multiple servers you can know where it’s coming from. Note: You shouldn’t perform arbitrary API requests just because this parameter exists, since anybody can easily fake it.