webex-js-sdk-bundling-examples

Overview

Demonstrates 'webpack' bundling of the Webex JavaScript SDK and Momentum-UI style assets for use in browser application integrations.

Bundling frameworks demonstrated:

This project was built/tested using:

https://developer.webex.com/docs/sdks/browser

Getting started

  1. From a terminal, clone this repo using git:

    git clone https://github.com/CiscoDevNet/webex-js-sdk-bundling-examples.git
  2. Install dependencies:

    cd webex-js-sdk-bundling-examples
    npm install
  3. Use OpenSSL] to create a self-signed key/certificate pair for serving pages with HTTPS:

    openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
  4. Build and serve the sample web page using one of the available bundlers:

    npm run webpack
    npm run browserify
    npm run parcel
  5. Open a web browser and navigate to https://localhost:3000

  6. You can test the sample by logging into developer.webex.com and grabbing a Personal Access Token from the Getting Started page, then dialing another Webex Teams user via their Webex Id/email

    Don't connect and dial based on the same user - that won't work!

Hints

  • There is a workaround in webpack/webpack.config.js for an issue Webpack has with the fs module that's a dependency of webex, but not actually needed in browser usage:
    ...
    resolve: {
        fallback: { 
            "fs": false
        }
    }
    ...
  • As of @webex 2.54.0, browserify > v16.5.1 bundling fails, see: cisco/node-jose#301

  • See package.json for the browserlists array of target browsers/versions

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.