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

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