Appearance
Hooks reference
api.hooks.filter(name, callback) registers an ordered transformation. Return the input unchanged when the plugin does not apply.
| Hook | Value | Timing and purpose |
|---|---|---|
settings:filter | PluginSettings | Startup only; changes approved presentation, language, and feature settings. |
brands:filter | PluginBrandRecord[] | Filters or annotates the brand-directory list. |
wheel-results:filter | PluginWheelResults | Transforms already-loaded results before supported result surfaces render. |
wheel-destination:resolve | WheelDestinationRequest | Resolves route, external, or cancelled wheel navigation. |
price:resolve | PluginPriceResolution | Synchronously transforms already-loaded prices and labels. |
rfq-payload:filter | PluginRecord | false | Transforms or cancels the outgoing RFQ payload. |
landing-featured-brands:filter | PluginBrandRecord[] | Transforms featured landing brands. |
landing-featured-wheels:filter | PluginWheelRecord[] | Transforms featured landing wheels. |
Important timing rules
- Register
settings:filterbefore the embed starts. price:resolvemust 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:filterreceives the brand-directory array.landing-featured-brands:filterreceives featured landing brands.landing-featured-wheels:filterreceives featured landing wheels.wheel-results:filterreceives 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.