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

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