Task

View as Markdown

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

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.

1import { SignalWire } from "@signalwire/realtime-api";
2
3const client = await SignalWire({ project: "ProjectID Here", token: "Token Here"})
4
5const taskClient = client.task
6
7await taskClient.listen({
8 topics: ['office'],
9 onTaskReceived: (payload) => {
10 console.log('Received task', payload)
11 }
12});

Classes