Skip to main content

BlockingEventHandlerOptions

Options for registering a blocking event handler.

Signature
type BlockingEventHandlerOptions<T extends VendureEvent> = {    event: Type<T> | Array<Type<T>>;    handler: (event: T) => void | Promise<void>;    id: string;    before?: string;    after?: string;}

event

propertyType<T> | Array<Type<T>>

The event type to which the handler should listen. Can be a single event type or an array of event types.

handler

property(event: T) => void | Promise<void>

The handler function which will be executed when the event is published. If the handler returns a Promise, the event publishing code will wait for the Promise to resolve before continuing. Any errors thrown by the handler will cause the event publishing code to fail.

id

propertystring

A unique identifier for the handler. This can then be used to specify the order in which handlers should be executed using the before and after options in other handlers.

before

propertystring

The ID of another handler which this handler should execute before.

after

propertystring

The ID of another handler which this handler should execute after.

Was this chapter helpful?
Report Issue
Edited Feb 3, 2026·Edit this page