Skip to main content

Task

Access the Task API. You can instantiate a Task.Client to receive tasks from a different application.

info

Refer to Task Events for the full list of events that a Task.Client can subscribe to.

Example

The following example listens for incoming tasks on the office topic and logs the payload to the console.

import { SignalWire } from "@signalwire/realtime-api";

const client = await SignalWire({ project: "ProjectID Here", token: "Token Here"})

const taskClient = client.task

await taskClient.listen({
topics: ['office'],
onTaskReceived: (payload) => {
console.log('Received task', payload)
}
});

Classes