Skip to content

registerFunctionDecorator

registerFunctionDecorator(functionName, plugin): void

Decorate a named SDK function — observe its calls or transform its arguments / return value without forking.

Common decoration targets: 'trackFutureChange' (state-mutation tracking), diagram-listener emitters, save callbacks. See the Build a plugin guide for the authoritative list of decoratable functions.

Safe to call more than once; pass plugin.name to deduplicate.

string

FunctionDecoratorOptions

void

registerFunctionDecorator('trackFutureChange', {
place: 'after',
callback: ({ params }) => auditLog(params),
name: 'audit-log',
});