The purpose of this project is to build off of the Webex React OAuth Sample App and integrate the Webex Meetings Widget. The setup is a basic site that utilizes the implicit grant flow available for Webex Integrations.
After authorizing the application, a meeting destination is entered and the Meeting Widget opens to that destination. Webex meeting destinations can be an email address, user ID, room ID or SIP address.
This project was bootstrapped with Create React App.
- π OAuth Integration - Implicit grant flow authentication with Webex
- π₯ Meeting Widget - Complete embedded Webex meeting experience
- π§ Multiple Destinations - Support for email, user ID, room ID, and SIP address
- β‘ Quick Setup - Environment variable configuration for easy deployment
- π± Responsive Design - Works on desktop and mobile devices
- π Live Demo - Hosted GitHub Pages deployment for immediate testing
View the live demo here: https://webexsamples.github.io/webex-meeting-widget-starter/
The project uses environment variables to configure the Webex API Integration.
- Node.js 14.x or later
- Yarn or npm package manager
- Valid Webex Integration from Webex Developer Portal
-
Clone the repository:
git clone <repository-url> cd webex-meeting-widget-starter
-
Install dependencies:
yarn install # or npm install
-
Configure environment variables:
Project configuration lives in a
.env
file. A sample.env.sample
has been provided for ease of use.- Rename the
.env.sample
file to.env
- Fill in your client ID provided from the Webex Developer Portal
# Copy the sample file cp .env.sample .env # Edit the .env file with your credentials REACT_APP_WEBEX_CLIENT_ID=your_client_id_here REACT_APP_WEBEX_BASE_URL=https://webexapis.com/v1/authorize
- Rename the
-
Start the development server:
yarn start
-
Access the application:
- Open http://localhost:3000 to view it in the browser
- Click "Login to Webex" to authenticate
- Enter a meeting destination when prompted
-
Initial Load:
- Application checks for existing OAuth token
- If no token exists, displays OAuth login link
-
OAuth Login:
- Redirects to Webex OAuth authorization page
- User grants permissions to the application
- Returns with access token in URL hash
-
Token Management:
- Custom hook extracts and stores token securely
- Clears sensitive data from URL for security
// Simple widget integration
<WebexMeetingWidget
accessToken={webexToken}
meetingDestination={destination}
/>
Destination Type | Format | Example |
---|---|---|
Email Address | user@domain.com | john.doe@company.com |
User ID | Webex User ID | Y2lzY29zcGFyazovL3VzL1BFT1BMRS... |
Room ID | Webex Room ID | Y2lzY29zcGFyazovL3VzL1JPT00v... |
SIP Address | SIP URI | meeting@example.webex.com |
- Supported: Webex meetings SIP URIs and Webex cloud-registered devices
- Not Supported: Webex Calling or third-party SIP URIs
webex-meeting-widget-starter/
βββ public/
β βββ index.html # Main HTML template
β βββ favicon.ico # Site favicon
β βββ manifest.json # PWA manifest
β βββ robots.txt # Search engine directives
βββ src/
β βββ App.js # Main application component
β βββ App.css # Application styles
β βββ OAuthLink.js # OAuth authorization link component
β βββ WebexMeeting.js # Meeting widget container
β βββ WebexMeeting.css # Meeting widget styles
β βββ WebexMeetingDestination.js # Destination input component
β βββ WebexMeetingDestination.css # Destination input styles
β βββ useCurrentUri.js # Hook for current URL handling
β βββ useWebexOAuth.js # Hook for OAuth token management
β βββ index.js # React application entry point
βββ .env.sample # Environment variables template
βββ package.json # Dependencies and scripts
βββ LICENSE # Cisco Sample Code License
βββ README.md # This documentation
Component | Description | File Location |
---|---|---|
App | Main application container and routing logic | App.js |
OAuthLink | Webex OAuth authorization link generator | OAuthLink.js |
WebexMeeting | Meeting widget wrapper and state management | WebexMeeting.js |
WebexMeetingDestination | User input form for meeting destinations | WebexMeetingDestination.js |
useWebexOAuth | OAuth token extraction and management hook | useWebexOAuth.js |
useCurrentUri | Current URL formatting for OAuth redirect | useCurrentUri.js |
// 1. Initial load - check for token
const webexToken = useWebexOAuth();
const redirectURI = useCurrentUri();
// 2. Conditional rendering based on authentication
{webexToken ?
<WebexMeeting webexToken={webexToken} /> :
<OAuthLink clientID={clientID} redirectURI={redirectURI} />
}
// 3. Widget rendering after destination selection
<WebexMeetingWidget
accessToken={webexToken}
meetingDestination={destination}
/>
// Required widget dependencies
import {WebexMeetingWidget} from '@webex/widgets';
import '@webex/widgets/dist/webexWidgets.css';
// Minimal widget setup
function WebexMeeting({webexToken}) {
const [destination, setDestination] = useState(null);
return (
<WebexMeetingWidget
accessToken={webexToken}
meetingDestination={destination}
/>
);
}
// OAuth link generation
const oauthURL = `${webexAPIBaseURL}?client_id=${clientID}&response_type=token&redirect_uri=${redirectURI}&scope=spark%3Aall%20spark%3Akms`;
In the project directory, you can run:
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits. You will also see any lint errors in the console.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes. Your app is ready to be deployed!
See the section about deployment for more information.
Deploys the built application to GitHub Pages.
This is configured with the predeploy
script that automatically builds before deployment.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
# Required environment variables
REACT_APP_WEBEX_CLIENT_ID=your_webex_client_id
REACT_APP_WEBEX_BASE_URL=https://webexapis.com/v1/authorize
The application requests the following OAuth scopes:
spark:all
- Full access to Webex APIsspark:kms
- Key Management Service access for secure meetings
The application automatically configures the redirect URI based on the current deployment URL:
- Development:
http://localhost:3000
- Production: Your deployed domain (GitHub Pages, etc.)
-
Authentication Flow:
- Test OAuth login process
- Verify token extraction and storage
- Check redirect URI handling
-
Widget Functionality:
- Test different destination types (email, user ID, room ID, SIP)
- Verify meeting widget loads correctly
- Test meeting controls and features
-
Responsive Design:
- Test on different screen sizes
- Verify mobile compatibility
- Check widget responsiveness
Browser | Version | Widget Support |
---|---|---|
Chrome | 90+ | β Full Support |
Firefox | 88+ | β Full Support |
Safari | 14+ | β Full Support |
Edge | 90+ | β Full Support |
Issue | Solution |
---|---|
OAuth Login Fails | Verify client ID and redirect URI configuration |
Widget Not Loading | Check access token validity and destination format |
Destination Invalid | Ensure destination follows supported format patterns |
CORS Errors | Verify redirect URI matches your domain exactly |
// Enable widget debugging
console.log('Token:', webexToken);
console.log('Destination:', destination);
// Check OAuth hash parameters
console.log('URL Hash:', window.location.hash);
We truly appreciate your contribution to the Webex Samples!
- Fork the repository
- Create a feature branch:
git checkout -b feature/widget-enhancement
- Commit changes:
git commit -am 'Add widget feature'
- Push to branch:
git push origin feature/widget-enhancement
- Submit a Pull Request
- Follow React functional component patterns
- Use PropTypes for component validation
- Maintain OAuth security best practices
- Test widget integration thoroughly
- Update documentation for new features
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
- Webex Widgets Documentation
- Webex Integration Guide
- OAuth 2.0 Implicit Grant Flow
- Webex Meeting Destinations
This project is licensed under the Cisco Sample Code License - see the LICENSE file for details.
For technical support and questions:
- Issues: Submit via GitHub Issues
- Widget Documentation: Webex Widgets Repository
- API Documentation: Webex Developer Portal
- Community: Webex Developer Community
Made with β€οΈ by the Webex Developer Relations Team at Cisco
Note: This starter template provides a foundation for integrating Webex Meeting Widgets. For production use, consider additional security measures, error handling, and user experience optimizations.