setMetadata

View as MarkdownOpen in Claude

Set function-scoped metadata key-value pairs. Metadata is scoped to the current function’s meta_data_token, so each function maintains its own independent metadata store. Maps to the set_meta_data SWML action.

Parameters

data
Record<string, unknown>Required

Object of key-value pairs to store as metadata.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .setMetadata({ department: 'sales', priority: 'high' });