getSection

View as MarkdownOpen in Claude

Retrieve a top-level section from the prompt by its title string.

Parameters

title
stringRequired

The section heading to retrieve.

Returns

PomSection | undefined — The matching section, or undefined if no section with that title exists.

Example

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4pom.addSection('Greeting', { body: 'Welcome the caller warmly.' });
5const section = pom.getSection('Greeting');
6console.log(section?.body); // "Welcome the caller warmly."