Riven’s internal communication is entirely event-driven. Every stage of the media pipeline — from bootstrapping the server to delivering a stream link — emits a typedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rivenmedia/riven-ts/llms.txt
Use this file to discover all available pages before exploring further.
RivenEvent that plugins can subscribe to via the hooks field of their RivenPlugin definition. Each event is defined as a Zod discriminated union member, providing full runtime validation on both emission and handling.
type string. Each handler receives { event, dataSources, settings, logger } — where event contains the payload fields (without the type discriminant). Riven validates the return value against the corresponding response schema before continuing.ProgramEvent Type Helper
All internal events are built with the ProgramEvent<Type, Payload> generic. The type discriminant is always prefixed with riven.; the Payload object is merged directly into the top-level event shape.
ParamsFor<T> helper to extract just the payload fields from a known event type, stripping the type discriminant:
Lifecycle Events
These events fire at the boundaries of the Riven process lifetime.riven.core.started
riven.core.started
riven.core.shutdown
riven.core.shutdown
SIGTERM / SIGINT before the process exits.Content Service Event
riven.content-service.requested
riven.content-service.requested
updateIntervalSeconds: null to use Riven’s default polling interval, or a non-negative integer to override it dynamically.Item Request Events
Events in this group track the lifecycle of anItemRequest — the record created when a user or content service asks Riven to acquire a piece of media.
riven.item-request.create.success
riven.item-request.create.success
ItemRequest row has been successfully persisted.Payload:riven.item-request.create.error
riven.item-request.create.error
ItemRequest fails for a general reason.Payload:riven.item-request.create.error.conflict
riven.item-request.create.error.conflict
imdbId / tmdbId / tvdbId).Payload:riven.item-request.removed
riven.item-request.removed
ItemRequest and all its associated MediaItem records have been deleted.Payload:riven.item-request.update.success
riven.item-request.update.success
ItemRequest has been updated — for example when additional seasons are requested for an existing show.Payload:Indexing Events
Indexing is the first processing stage: Riven emits a request event carrying external IDs and expects an indexer plugin to return rich metadata (title, genres, seasons, episodes, etc.).riven.media-item.index.requested.movie
riven.media-item.index.requested.movie
null when no indexing was performed (e.g. item already indexed).riven.media-item.index.requested.show
riven.media-item.index.requested.show
riven.media-item.index.success
riven.media-item.index.success
riven.media-item.index.error
riven.media-item.index.error
riven.media-item.index.error.incorrect-state
riven.media-item.index.error.incorrect-state
ItemRequest that has already been indexed (state machine guard).Payload:Scraping Events
Scraping is the second pipeline stage: Riven emits a request for torrent/magnet links for an indexedMediaItem and expects a scraper plugin to return a map of infoHash → magnet pairs.
riven.media-item.scrape.requested
riven.media-item.scrape.requested
riven.media-item.scrape.success
riven.media-item.scrape.success
riven.media-item.scrape.error
riven.media-item.scrape.error
riven.media-item.scrape.error.incorrect-state
riven.media-item.scrape.error.incorrect-state
riven.media-item.scrape.error.no-streams-found
riven.media-item.scrape.error.no-streams-found
Downloading Events
After a stream is selected, Riven hands off to a downloader plugin (typically a debrid service) via these events.riven.media-item.download.requested
riven.media-item.download.requested
riven.media-item.download.cache-check-requested
riven.media-item.download.cache-check-requested
riven.media-item.download.success
riven.media-item.download.success
riven.media-item.download.partial-success
riven.media-item.download.partial-success
riven.media-item.download.error
riven.media-item.download.error
riven.media-item.download.error.incorrect-state
riven.media-item.download.error.incorrect-state
riven.media-item.download.provider-list-requested
riven.media-item.download.provider-list-requested
Streaming Events
Once aMediaEntry has a downloadUrl, Riven can request a permanent or expiring stream link from the plugin that created it.
riven.media-item.stream-link.requested
riven.media-item.stream-link.requested
MediaEntry.Payload:riven.media-item.stream-link.health-check.requested
riven.media-item.stream-link.health-check.requested
Subtitle Event
riven.media-item.subtitle.requested
riven.media-item.subtitle.requested
External Event
External events are emitted into Riven from outside — typically by a GraphQL mutation or a content-service callback — rather than being emitted by the core pipeline. They use theriven-external. prefix instead of riven..
riven-external.item-requested
riven-external.item-requested
ctx.sendEvent() inside a resolver.Payload: