export function myCustomPlugin(options) {
name: '@yourcompany/outsmartly-plugin-does-something',
setup({ config, messageBus }) {
// Listening for messages, globally
messageBus.on('Something.HAPPENED', async (event) => {
const { message } = event;
// do something with it, such as call fetch()
// Adding custom middleware
config.middleware.unshift(async (event, next) => {
const response = await next();
return new Response('hello, world!');