A comprehensive Webex Embedded App that demonstrates the Embedded App Sidebar feature. This React-based application serves as a mock customer relationship manager (CRM) tool that utilizes the Embedded App SDK to automatically look up and display customer data for incoming Webex calls.
- Real-time Call Monitoring: Automatically detect and display incoming/outgoing Webex calls
- Customer Lookup: Generate and display mock customer data for call participants
- Call State Tracking: Visual progress indicators showing call states (Started, Connecting, Connected, Hold, Disconnecting, Disconnected, Rejected, Ended)
- Interactive UI: Modern Material Design interface with modals and badges
- Badge Integration: Dynamic sidebar badge showing active call count
- Call Simulation: Test functionality with simulated call events
- Event Logging: Comprehensive logging of all call events with timestamps
- React 18: Modern React with hooks and functional components
- Webex Embedded App SDK: For Webex integration and call event handling
- Materialize CSS: Material Design UI framework
- Faker.js: For generating realistic mock customer data
- Husky: Git hooks for code quality
- Prettier: Code formatting
- GitHub Actions: Automated formatting checks
- Node.js (v14 or higher)
- npm or yarn
- Webex Teams account
- Webex Embedded App configuration
Follow these steps to set up and run this project:
git clone git@github.com:WebexSamples/CallMonitorApp.git
cd CallMonitorAppNavigate to the project directory and install the necessary dependencies:
npm installRun the server for the application:
npm startThis will start the development server at http://localhost:3000.
Follow the instructions here to create a new Webex Embedded App with the Start URL configured as your server's address (e.g., http://localhost:3000 for local development).
CallMonitorApp/
โโโ public/ # Static assets
โ โโโ index.html # Main HTML template
โ โโโ manifest.json # Web app manifest
โโโ src/ # Source code
โ โโโ App.js # Main application component
โ โโโ App.css # Main application styles
โ โโโ CallStateFlow.js # Call state progress indicator
โ โโโ CallStateFlow.css # Call state styling
โ โโโ Calls.js # Call display component
โ โโโ Customer.js # Customer profile modal
โ โโโ Events.js # Event logging component
โ โโโ NavBar.js # Navigation bar
โ โโโ Simulate.js # Call simulation component
โ โโโ generateCustomer.js # Fake customer data generator
โโโ .github/workflows/ # GitHub Actions
โโโ package.json # Dependencies and scripts
โโโ README.md # This file
The main application component that:
- Initializes the Webex Embedded App SDK
- Handles call event listening and processing
- Manages application state for calls and events
- Updates sidebar badges based on active calls
Visual progress indicator showing call states:
- Started: Call initiated
- Connecting: Attempting connection
- Connected: Call established
- Hold: Call on hold
- Disconnecting: Call ending
- Disconnected: Call ended
- Rejected: Call rejected
- Ended: Call completed
Customer profile modal displaying:
- Profile picture
- Contact information (name, email, phone)
- Address details
- Customer notes
- Account creation date
Generates realistic mock customer data using Faker.js:
- Personal information
- Contact details
- Address information
- Profile pictures
- Customer notes
- Join a Webex Call: Start or join a call in Webex Teams
- Open Sidebar: The app automatically appears in the sidebar
- View Call Data: Customer information is automatically generated and displayed
- Monitor Progress: Watch the call state progress indicator
- Access Details: Click the search icon to view detailed customer information
For testing without actual calls:
- Click Simulate: Use the simulate button in the navigation bar
- Enter Phone Number: Provide a phone number for the simulated caller
- Select Call State: Choose the desired call state
- View Results: The simulated call appears in the interface
The app integrates with Webex sidebar badges:
- Active Call Count: Shows number of ongoing calls
- Real-time Updates: Badge updates as calls start/end
- Visual Feedback: Provides immediate status to users
Comprehensive logging system tracks:
- All call state changes
- Event timestamps
- Call metadata
- Participant information
- Mobile-friendly: Works on various screen sizes
- Material Design: Modern, intuitive interface
- Accessibility: Proper contrast and keyboard navigation
This project uses Prettier to maintain code consistency. To format your code, run:
npm run formatThe project uses Husky for pre-commit hooks:
- Lint-staged: Automatically formats staged files
- Prettier: Ensures consistent code formatting
npm start # Start development server
npm run build # Build for production
npm test # Run tests
npm run format # Format code with Prettier
npm run deploy # Deploy to GitHub PagesThis project uses a GitHub Actions workflow to check if the code is formatted correctly with Prettier. The workflow runs on every pull request.
- Check out code: This step checks out your repository's code so the workflow can access it
- Use Node.js: This step sets up Node.js version 20 on the runner
- Install dependencies: This step installs the project's dependencies using
npm ci - Check formatting: This step runs
npx prettier --check .to check if all files are formatted correctly
If any files are not formatted correctly, the workflow will fail, and the PR will be marked as failed.
To see the results of the workflow, navigate to the "Actions" tab in your GitHub repository.
The application includes comprehensive testing setup:
- React Testing Library: For component testing
- Jest: Test runner and assertion library
- User Event: For simulating user interactions
Run tests with:
npm testThe app provides detailed console logging:
- SDK initialization status
- Call event processing
- Badge updates
- Error handling
- React DevTools: For component inspection
- Webex SDK Logs: Configurable log levels (INFO, WARN, ERROR, SILENT)
- Chrome DevTools: For debugging and performance analysis
- No sensitive data: All customer data is mock/generated
- Local development: Suitable for development and demonstration
- Webex authentication: Leverages Webex's built-in security
The project is configured for GitHub Pages deployment:
npm run deployFor custom deployment:
- Build the project:
npm run build - Deploy the
buildfolder to your hosting service - Update the Webex Embedded App configuration with the new URL
Key SDK methods used:
app.onReady(): Initialize the SDKapp.listen(): Start listening for eventsapp.on('sidebar:callStateChanged'): Handle call eventssidebar.showBadge(): Update sidebar badge
{
id: "unique-call-id",
callType: "Placed|Received",
state: "Started|Connecting|Connected|Hold|Disconnecting|Disconnected|Rejected|Ended",
localParticipant: {
callerID: "user-id",
name: "Display Name",
isMuted: boolean
},
remoteParticipants: [{
callerID: "phone-number",
name: "Participant Name"
}],
customer: {
// Generated customer data
},
eventTimeStamp: Date
}- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes
- Ensure code is formatted:
npm run format - Run tests:
npm test - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is licensed under the terms specified in the LICENSE file.
- Create an issue in this repository
- Visit Webex Developer Support
- Check the Embedded Apps Framework documentation
Made with โค๏ธ by the Webex Developer Evangelism Team at Cisco
Repository: https://github.com/WebexSamples/CallMonitorApp
Live Demo: https://webexsamples.github.io/CallMonitorApp