Send and Receive Text Messages

Product deprecation notice

Effective April 30th, 2026, Vonage In-App Messaging will no longer be available. Access for new users will be closed, and the service will be discontinued for all existing users.

If you have any questions regarding this product’s discontinuation, please contact your account manager or our support team.

Overview

This guide covers sending and receiving messages within a conversation.

Before you begin, make sure you added the SDK to your app and you are able to create a conversation.

NOTE: A step-by-step tutorial to build a chat application is available here.

This guide will make use of the following concepts:

  • Conversation Events - message events that fire on a Conversation, after you are a Member

Send a Text Message

Given a conversation you are already a member of:

conversation.sendMessage({
    "message_type": "text",
    "text": "Hi Vonage!"
}).then((event) => {
    console.log("message was sent", event);
}).catch((error)=>{
    console.error("error sending the message ", error);
});

Receive a Text Message

A message conversation event will be received when a member sends a text message to a conversation:

conversation.on('message', (sender, event) => {
    console.log('*** Message received', sender, event) 
});

Reference