Future plugin system will enable third-party extensions via lifecycle hooks, custom renderers, and action handlers. Build sentiment analysis, CRM integrations, custom moderation—all without modifying core code. Sandboxed for security and stability.
Every business has unique needs that generic solutions can't fully address. The planned plugin system will enable developers to extend widget functionality with custom capabilities — without forking code or losing upgrade paths.
Standard widgets can't predict every business requirement. You might need:
Plugins register during widget initialization and receive callbacks at key lifecycle moments:
onBeforeMessageSend — preprocess user messages before sending to backendonAfterMessageReceive — postprocess AI responses before renderingonConversationStart — initialize plugin state when conversation beginsonConversationEnd — clean up resources, log analyticsonWidgetOpen / onWidgetClose — track engagement, trigger side effectsonError — custom error handling or reportingPreprocessors modify user messages before sending:
- Spell-check and autocorrect
- Profanity filter or content moderation
- Data extraction (detect emails, phone numbers, order IDs)
- Sentiment detection
Postprocessors modify AI responses before rendering:
- Markdown enhancement (convert tables to interactive components)
- Link enrichment (preview URLs, unfurl metadata)
- Compliance filtering (redact PII, sensitive financial data)
Plugins can't compromise widget security or stability:
WidgetSDK.registerPlugin({
name: 'sentiment-analyzer',
version: '1.0.0',
hooks: {
onBeforeMessageSend: async (message, context) => {
const sentiment = await analyzeSentiment(message.text);
return { ...message, metadata: { sentiment } };
},
onAfterMessageReceive: (message, context) => {
if (message.metadata?.sentiment < -0.5) {
context.escalateToHuman(message);
}
return message;
}
}
});