validateVerb

View as MarkdownOpen in Claude

Lightweight validation of a verb config against the schema. Checks that the verb exists and that required properties are present.

Parameters

verbName
stringRequired

The verb name (e.g., "answer", "play").

config
unknownRequired

The verb configuration object to validate.

Returns

ValidationResult — An object with valid: boolean and errors: string[].

Example

1import { SchemaUtils } from '@signalwire/sdk';
2
3const schema = new SchemaUtils();
4const result = schema.validateVerb('play', { url: 'https://example.com/audio.mp3' });
5console.log(result.valid); // true
6console.log(result.errors); // []