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. If you've tried the service, please give us feedback through this survey.
- Visual Studio Code (Stable Build)
- Node.js (LTS version)
- Create an Azure account with an active subscription. For details, see Create an account for free.
- 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
. - Once you get the
Endpoint
, add the endpoint string to the Server/appsetting.json file. Input your endpoint in the variable:EndpointUrl
. - Get the
identity
from the Azure portal. Click onIdentities & User Access Tokens
in Azure portal. Generate a user withChat
scope. - Once you get the
identity
string, add the identity string to the Server/appsetting.json file. Input your identity string in the variable:AdminUserId
. This is the server user to add new users to the chat thread.
- Set your connection string in
Server/appsettings.json
- Set your endpoint URL string in
Server/appsettings.json
- Set your adminUserId 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.
- Teams Interop Meeting Chat Quickstart - To try out new beta features such as Rich Text Editor.
- FluentUI - Microsoft powered UI library
- React - Library for building user interfaces