Plugins Coming soon
The betterfound plugin system lets you extend the widget's behaviour without forking the core. Plugins hook into the conversation lifecycle, product rendering, and data pipeline — all from a lightweight JavaScript module you host yourself.
The plugin API is in design. This page documents the planned architecture so you can build against it as soon as it ships. Expected availability: Q3 2026.
What plugins can do
- Message hooks — intercept user messages and assistant responses before they render
- Product card renderer — replace the default card UI with your own component
- Data enrichment hooks — inject additional metadata into the product index at query time
- Analytics events — receive structured events for every widget interaction
- Custom tools — register new tools the AI can call (e.g. stock checker, size guide)
Planned plugin API
// my-plugin.js
export default {
name: 'my-betterfound-plugin',
version: '1.0.0',
// Called once when the widget initialises
onInit(context) {
context.analytics.on('product_click', (e) => {
console.log('Product clicked:', e.product.name)
})
},
// Intercept every user message
onUserMessage(message, next) {
return next(message) // pass through unchanged
},
// Override the product card render
renderCard(product) {
const el = document.createElement('div')
el.className = 'my-custom-card'
el.innerHTML = `<h3>${product.name}</h3>`
return el
},
}Registering a plugin
<script
src="https://cdn.betterfound.ai/widget/pf.js"
data-tenant="your-tenant-id"
data-plugins="https://your-cdn.com/my-plugin.js"
async
></script>Multiple plugins are comma-separated in data-plugins.
Analytics events reference (planned)
| Event | Payload | Description |
|---|---|---|
widget_open | { mode, trigger } | Widget opened |
message_sent | { text, sessionId } | User sent a message |
products_shown | { count, query } | Result set rendered |
product_click | { product, position } | Shopper clicked a card |
heart_toggle | { product, saved } | Wishlist add/remove |
Plugin marketplace — browse and install plugins from the dashboard