@twilio/flex-sdk
    Preparing search index...

    Class AddTaskParticipantListener<T>

    Adds a task participant event listener.

    The unique identifier (SID) of the task.

    The event name (e.g. participantAdded).

    The event listener function.

    A promise that resolves to an object containing the unsubscribe function to remove the listener.

    FlexSdkError with the following error code(s):

    import { createClient } from "@twilio/flex-sdk";
    import { AddTaskParticipantListener } from "@twilio/flex-sdk/actions/Task";

    async function addTaskParticipantListener() {
    const client = await createClient("SDK_TOKEN");

    const addTaskParticipantListener = new AddTaskParticipantListener(
    "WTxxx",
    "participantAdded",
    (task, participant) => {
    console.log(`Participant added: ${participant.sid} to task ${task.sid}`);
    }
    );
    const { unsubscribe } = await client.execute(addTaskParticipantListener);
    return unsubscribe;
    }

    Type Parameters

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Parameters

      • ctx: {}

      Returns Promise<{ unsubscribe: () => Task }>