JavaScript
Create the UI
Create the user interface for your web chat application.
The following HTML defines 2 <section> areas that you will use to display:
- Buttons to either log in as Alice or Bob
- The chat interface including the feed of messages along with a text area and button to send messages
The web page loads two scripts once the page body has rendered:
- The
vonageClientSDK.min.jsfile from the@vonage/client-sdkNode modules folder - The
chat.jsfile that will contain your application's code. Create this empty file in the project's root directory
Create a file named index.html in your project directory with the following contents:
Creating a web-based chat app
Create a web application that enables users to message each other
Steps
1
Introduction to this task2
Prerequisites3
Create a Vonage Application4
Create a conversation5
Create the users6
Add users to the conversation7
Generate JWTs8
Install Client SDK9
Create the UI10
Authenticate your Users11
Instantiate VonageClient and create a Session12
Show the message history13
Send a message14
Run your application15
What's next?