docs(plugins): document namespaced emitted events - #240
Closed
gabek wants to merge 2 commits into
Closed
Conversation
There was a problem hiding this comment.
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[].eventTypereflects 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.
| | `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 | |
Member
Author
|
Closing with owncast/owncast#5117. The public documentation will be recreated after issue #5093 and the runtime design are settled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sluggedchatemittingmessage.received).testing.mdx: scenarioemits.eventTypeis the dispatched name, so it carries the emitting plugin's slug prefix. Example expectation updated tomy-plugin.milestone.reached.The rest of the namespacing wording (
apis.mdxemit description,events.mdx,permissions.md) is already onowncast-docusaurus. This PR only adds what those pages were missing.Targets
owncast-docusaurusbecause the plugin docs live on that branch, not onmaster.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 testrun emits the unprefixed name and thetesting.mdxexample would not match. Note that the base branch already describes slug prefixing, so the same caveat applies to it independently of this PR.