getContext

View as MarkdownOpen in Claude

Retrieve an existing context by name for inspection or modification.

Parameters

name
stringRequired

Name of the context to retrieve.

Returns

Context if found, undefined otherwise.

Example

import { ContextBuilder } from '@signalwire/sdk';
const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('greet').setText('Greet the caller.');
const retrieved = builder.getContext('default');
if (retrieved !== undefined) {
retrieved.addStep('followup').setText('Ask if there is anything else.');
}