page_type | languages | products | ||||
---|---|---|---|---|---|---|
sample |
|
|
This is a sample application to show how we can use the @azure/communication-react
package to build a calling 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 call participant.
Additional documentation for this sample can be found on Microsoft Docs.
Before contributing to this sample, please read our contribution guidelines.
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 (12.18.4 and above)
- 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.
- ./Calling/src/app: Where the client code lives
- ./Calling/src/app/App.tsx: Entry point into the calling sample
- ./Calling/src/app/views/HomeScreen.tsx:
- ./Calling/src/app/views/CallScreen.tsx:
- ./Calling/src/app/views/EndCall.tsx:
- ./Calling/src/app/views/UnsupportedBrowserPage.tsx:
- ./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-calling-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 samples/Server/appsetting.json file. Input your connection string in the variable:ResourceConnectionString
.
- There are two other properties in the appsettings.json file (EndpointUrl, AdminUserId). For the Calling Hero Sample these two properties are unnecessary. We use this file with our chat hero sample and that is where those strings are used.
-
Install dependencies
npm run setup
-
Start the calling app
npm run start
This will open a client server on port 3000 that serves the website files, and an api server on port 8080 that performs functionality like minting tokens for call participants.
-
The app shows an "Unsupported browser" screen but I am on a supported browser.
If your app is being served over a hostname other then localhost, you must serve traffic over https and not http.
npm run setup
npm run build
npm run package
- Use the Azure extension and deploy the
Calling/dist
directory to your app service
- Azure Communication Services - UI Library - To learn more about what the
@azure/communication-react
package offers. - Azure Communication Calling SDK - To learn more about the calling web sdk
- FluentUI - Microsoft powered UI library
- React - Library for building user interfaces