Skip to content

Custom Utilities

Need to add a custom utility that will be consumed by multiple widgets? This guide will show you how to do that.

OneFEShellOptions.utils

Here is an example on how to add a custom widget logger.

import renderOneFEShell from '@devhub/1fe-shell';
renderOneFEShell({
utils: {
initializeLogger: (widgetId: string) => ({
logger: {
log: (message: string) => {
console.log(widgetId, message);
},
error: (message: string) => {
console.error(widgetId, message);
},
},
}),
}
});