StandaloneCollectAction

View as MarkdownOpen in Claude

Returned from call.collect(). Tracks a standalone input collection (without an accompanying play prompt). Terminal states: finished, error, no_input, no_match.

Inherits all properties and methods from the base Action interface (controlId, isDone, completed, result, wait()).

Properties

No additional properties beyond the base Action interface.

Methods

Example

import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_TOKEN!,
contexts: ['default']
});
client.onCall(async (call) => {
await call.answer();
const action = await call.collect({
speech: { end_silence_timeout: 2.0 },
initialTimeout: 10.0,
startInputTimers: false,
});
const event = await action.wait();
const result = event.params.result ?? {};
});
await client.run();