page_type | languages | products | ||||
---|---|---|---|---|---|---|
sample |
|
|
This is a sample application to show how we can use the @azure/communication-react
package to build a chat experience.
Learn more about the Azure Communication Services UI Library.
The client-side application is a React based user interface. Alongside this front-end is a NodeJS web application powered by ExpressJS that performs functionality like minting new user tokens for each chat participant.
Additional documentation for this sample can be found on Microsoft Docs.
We appreciate your feedback and energy helping us improve our services. Please let us know if you are satisfied with ACS through this survey.
- Create an Azure account with an active subscription. For details, see Create an account for free.
- Node.js (12.18.4 and above)
- Visual Studio (2017 and above)
- Create an Azure Communication Services resource. For details, see Create an Azure Communication Resource. You'll need to record your resource connection string for this quickstart.
- ./Chat/src/app: Where the client code lives
- ./Chat/src/app/App.tsx: Entry point into the chat sample
- ./Chat/src/app/HomeScreen.tsx: The first screen in the chat sample
- ./Chat/src/app/ConfigurationScreen.tsx: Where to set your name and avatar for the chat
- ./Chat/src/app/ChatScreen.tsx: The main chat thread screen
- ./Chat/src/app/EndScreen.tsx: The screen the user will see when they are no longer in the chat thread
- ./Chat/src/app/ErrorScreen.tsx: The screen when an error occurs in the chat thread
- ./Server: server code
- ./Server/appsettings.json: Where to put your azure communication services connection string
- Open an instance of PowerShell, Windows Terminal, Command Prompt or equivalent and navigate to the directory that you'd like to clone the sample to.
git clone https://github.com/Azure-Samples/communication-services-web-chat-hero.git
- Get the
Connection String
from the Azure portal. For more information on connection strings, see Create an Azure Communication Resources - Once you get the
Connection String
, Add the connection string to the Server/appsettings.json file found under the Chat folder. Input your connection string in the variable:ResourceConnectionString
.
- Set your connection string in
Server/appsettings.json
npm run setup
from the root directorynpm run start
from the root directory
npm run setup
npm run build
npm run package
- Use the Azure extension and deploy the Chat/dist directory to your app service
- Azure Communication Services - UI Library - To learn more about what the
@azure/communication-react
package offers. - Azure Communication Chat SDK - To learn more about the chat web sdk
- FluentUI - Microsoft powered UI library
- React - Library for building user interfaces