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

    Class AddConversationEventListener<T>

    Adds a conversation event listener to the client.

    The name of the event to listen for (e.g. "conversationAdded").

    The event listener function to be called when the event occurs.

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

    import { createClient } from "@twilio/flex-sdk";
    import { AddConversationEventListener } from "@twilio/flex-sdk/actions/Conversation";

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

    const addConversationEventListener = new AddConversationEventListener("conversationAdded", (conversation) => {
    // Handle incoming conversation
    });
    const result = await client.execute(addConversationEventListener);
    return result;
    }

    Type Parameters

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Parameters

      • ctx: {}

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