Skip to content

Hooks reference

api.hooks.filter(name, callback) registers an ordered transformation. Return the input unchanged when the plugin does not apply.

HookValueTiming and purpose
settings:filterPluginSettingsStartup only; changes approved presentation, language, and feature settings.
brands:filterPluginBrandRecord[]Filters or annotates the brand-directory list.
wheel-results:filterPluginWheelResultsTransforms already-loaded results before supported result surfaces render.
wheel-destination:resolveWheelDestinationRequestResolves route, external, or cancelled wheel navigation.
price:resolvePluginPriceResolutionSynchronously transforms already-loaded prices and labels.
rfq-payload:filterPluginRecord | falseTransforms or cancels the outgoing RFQ payload.
landing-featured-brands:filterPluginBrandRecord[]Transforms featured landing brands.
landing-featured-wheels:filterPluginWheelRecord[]Transforms featured landing wheels.

Important timing rules

  • Register settings:filter before the embed starts.
  • price:resolve must return synchronously because it runs during rendering and total calculation.
  • Hooks run in plugin registration order.
  • Invalid values are attributed to the plugin and the previous valid value continues when possible.
  • Hooks transform existing app data; they do not expose raw API request construction.

Callback contract

ts
type HookFilter<T> = (
  value: T,
  context: {
    hook: string
    pluginId?: string
    source?: string
  },
) => T | Promise<T>

The SDK infers T from a known hook name. Although the shared callback type permits a promise, price:resolve is explicitly synchronous.

settings:filter

ts
type PluginSettings = {
  options: PluginSettingsOptions
  languages: Array<Record<string, unknown> & { langName: string }>
}

Approved option fields cover public presentation content, theme values, search and shopping feature switches, tire visibility, inventory visibility, and pricing visibility. This hook runs once during startup.

Catalog filters

  • brands:filter receives the brand-directory array.
  • landing-featured-brands:filter receives featured landing brands.
  • landing-featured-wheels:filter receives featured landing wheels.
  • wheel-results:filter receives a record containing available wheels, specs, assets, brands, and result counts.

Catalog filters may remove, reorder, replace, or annotate existing records. Return new arrays and records.

wheel-destination:resolve

ts
type WheelDestinationRequest = {
  source: string
  wheel: unknown
  wheelCard?: unknown
  brand?: PluginBrandRecord | null
  vehicle?: unknown
  filters?: Record<string, unknown>
  destination:
    | { type: 'route'; to: PluginRouteLocation }
    | { type: 'external'; url: string; target?: '_self' | '_blank' }
    | { type: 'cancel' }
}

Return the request unchanged when the plugin does not own the destination.

price:resolve

The value contains source, productType, optional wheel/spec/vehicle context, immutable base prices, the current price and comparison price, and customer-facing labels. See Customize pricing.

rfq-payload:filter

Return a transformed public record to continue submission or false to cancel it. Do not add browser-visible credentials. Server-authenticated enrichment belongs on a customer-owned backend.

Reserved name

wheel-query:filter is reserved but not implemented. It has no public value type or application call site. Registering it has no effect.

Icon Visualizer developer documentation