Object representing a Rokt placement loaded on a page. Provides functionality to interact with the placement on a page.
▸ close(): Promise<void>
Closes and removes the placement from the page.
Allows subscribing to events with a specific name coming from a placement.
|string||Name of the event to subscribe to|
▸ ready(): Promise<T>
Allows waiting for a placement to be ready. Readiness is defined as:
- placement has loaded successfully
- placement is ready to receive events sent using the send method.
If for any reason a placement fails to be loaded, the promise is going to be rejected with an error.
data?: T): Promise<void>
Sends an event to the placement. Returned promise will be resolved once placement handles the message.
|string||Name of the event|
|T||Optional payload for a given event|