Skip to content

PlacementTypeRegistry

Registry for placement slot types.

Manages built-in and custom placement renderers. The registry resolves a PlacementOutput to the best matching slot type based on surface type and template, then provides the component and resolved props for rendering.

get(id): PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined

Look up a slot type by its id.

string

PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined


has(id): boolean

Check if a slot type id is registered.

string

boolean


listAll(): PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]

List all registered slot types.

PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]


listBySurfaceType(surfaceType): PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]

List slot types for a specific surface type.

"custom" | "inline" | "banner" | "modal" | "tooltip" | "sidebar" | "toast" | "fullscreen" | "email" | "sms" | "push" | "in_page" | "button" | "full_page" | "agent" | "cli"

PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]


register<P>(options): void

Register a placement slot type. If a type with the same id already exists, it is replaced (allows customer overrides of built-in types).

P extends PlacementSlotProps<ResolvedContent>

RegisterPlacementSlotTypeOptions<P>

void


resolve(output): PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined

Resolve the best matching slot type for a placement output.

Resolution order:

  1. If the output’s surface.template matches a registered type id, use it
  2. Find all types for the output’s surface.type, sort by priority descending, and pick the first whose accepts() returns true
  3. Fall back to a ‘custom’ type if registered
  4. Return undefined if no match

PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined


unregister(id): boolean

Unregister a placement slot type by id. Returns true if the type was found and removed.

string

boolean