Skip to content

docs(plugins): document namespaced emitted events - #240

Closed
gabek wants to merge 2 commits into
owncast-docusaurusfrom
fix/plugin-event-namespacing
Closed

docs(plugins): document namespaced emitted events#240
gabek wants to merge 2 commits into
owncast-docusaurusfrom
fix/plugin-event-namespacing

Conversation

@gabek

@gabek gabek commented Aug 9, 2026

Copy link
Copy Markdown
Member

Documents the host-side custom event namespacing added in owncast/owncast#5117 (issue owncast/owncast#5093), matching owncast/plugin-sdk#15.

Changes

  • apis.mdx: note that the host drops an emitted name that, once prefixed with your slug, would equal a built-in event (a plugin slugged chat emitting message.received).
  • testing.mdx: scenario emits.eventType is the dispatched name, so it carries the emitting plugin's slug prefix. Example expectation updated to my-plugin.milestone.reached.

The rest of the namespacing wording (apis.mdx emit description, events.mdx, permissions.md) is already on owncast-docusaurus. This PR only adds what those pages were missing.

Targets owncast-docusaurus because the plugin docs live on that branch, not on master.

Merge order

This branch documents behavior that is not in a released Owncast yet, so it should publish only after a release carries owncast/owncast#5117. Until then a reader's owncast-plugin test run emits the unprefixed name and the testing.mdx example would not match. Note that the base branch already describes slug prefixing, so the same caveat applies to it independently of this PR.

Copilot AI lite review requested due to automatic review settings August 9, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the plugin testing documentation to clarify how emits.eventType is represented in scenario expectations, aligning it with the host’s namespacing behavior for plugin-emitted events.

Changes:

  • Clarify that expect.emits[].eventType reflects the dispatched (slug-prefixed) event name.
  • Update the example scenario expectation to use the fully-qualified event name my-plugin.milestone.reached.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/plugins/testing.mdx
| `uploads` | List of `{ name, body?, bodyBase64? }` from `owncast.storage.upload`. `name` is always checked. Non-empty `body` values compare text. Present `bodyBase64` values compare exact decoded bytes |
| `videoConfigWrites` | List of partial configs applied via `owncast.videoConfig.write()` |
| `emits` | List of `{ eventType, payload }` for `owncast.events.emit` calls |
| `emits` | List of `{ eventType, payload }` for `owncast.events.emit` calls. `eventType` is the dispatched name, so it carries your plugin's slug prefix |
@gabek

gabek commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

Closing with owncast/owncast#5117. The public documentation will be recreated after issue #5093 and the runtime design are settled.

@gabek gabek closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants