Twilio’s Conversations SDK builds virtual spaces (conversations) for users to communicate across multiple channels. Instead of building separate solutions for online chat versus SMS or WhatsApp engagement, we can provide the communication experience across all of them using one SDK.

In this lesson, we’ll interact with a demo Conversations application. To get the demo application up and running, we need to go through the following steps:

  1. Create a conversation.

  2. Add an SMS participant to the conversation.

  3. Add a second participant to the conversation.

  4. Create an access token.

  5. Run the demo application. We’ll see our conversations listed in the sidebar. Select a conversation and start chatting.

Create the first conversation

Now, let’s create our first conversation. The conversation is the primary source that will include the participants and messages.

To create a conversation, we’ll first create a client object and initialize it using our Account SID and Auth Token.

We’ll create a conversation in the following code. We can define a friendly name for our conversation by passing it as an input parameter.

Get hands-on with 1200+ tech skills courses.