Conversation Provider

The Conversation provider allows you to listen for webhooks from the Conversation API.

Functions

  • onConversationEvent - this allows you to listen for and filter Conversation API events. See the code snippet here.

Use the vcr.verifyAuth method to verify that callbacks originate from the Cloud Runtime Platform. As this provider routes webhooks via the VCR callback router, you must also validate the X-Vonage-Webhook-Auth-Token header to confirm the event originated from Vonage. See Verify a Callback for full guidance.

Initializing the Conversation Provider

To use the Conversation Provider you need to create an instance of the provider using a session:

const session = vcr.createSession();
const messaging = new Conversation(session);

Use Case

For example, to use the use the Conversation provider to listen for conversation events for a Vonage application:

const session = vcr.createSession();
const conversation = new Conversation(session);

await conversation.onConversationEvent("onEvent");