Git Product home page Git Product logo

webex-js-sdk's Introduction

Webex JS SDK

license: Cisco state: Stable scope: Public

This project is designed as a mono-repository for all publicly-provided JavaScript packages from Cisco's Webex Developer Experience team. These packages consist of mostly API-related modules that allow for seamless integration with the collection of services that belong to the Webex platform.

Installation

Since this project is a mono-repository, it provides multiple ways to consume its distributables. Please see the respective sections below for information on how to install and consume this project.

Unified Modules

Unified modules are the quickest way to begin development using the Webex JS SDK. These modules are meant to be consumed as dependencies of another project and can be installed by performing the following commands:

# using NPM
npm install {module}

# using Yarn
yarn add {module}

In addition to the module consumption via NPMJS, these modules can also be consumed via our CDN. See the below examples of how to consume the unified modules via our CDN:

<html>
  <head>
    <!-- via unpkg -->
    <script crossorigin src="https://unpkg.com/webex@^1/umd/webex.min.js"></script>

    <!-- via jsdelivr -->
    <script crossorigin src="https://cdn.jsdelivr.net/npm/webex/umd/webex.min.js"></script>
  </head>
  <!-- ...application html... -->
</html>

The available unified modules within this project are listed below:

  • webex - The primary webex unified module.

Modular Modules

Modular modules are an alternative to using a unified module, and require a greater understanding of how the modules are architected in order to consume them appropriately. These modules are typically consumed as dependencies of another project and can be installed by performing the following commands:

# using NPM
npm install {module}

# using Yarn
yarn add {module}

The available modular modules within this project are visible when inspecting the contents of the ./packages/@webex/ folder, as well as other published modules (see their README.md files) within the ./packages/ folder.

Usage

This section will define the general usage examples for this project.

Module Consumption

For general consumption documentation, please visit our Cisco Webex for Developers portal, as this will typically what is necessary to begin development using the various packages within the Webex JS SDK. Additionally, some of the modules within this project contain independent documentation available within each of their respective folder scopes. Please review these independent documentation articles as needed.

It is recommended to visit our Getting Started with NodeJS guide for the most up-to-date documentation on consuming the Webex JS SDK via Module.

Browser Consumption

This section outlines how to directly consume the Webex JS SDK unified webex bundle within your HTML document. This bundle can be consumed directly via unpkg or jsdelivr respectfully. See the below examples:

<html>
  <head>
    <!-- via unpkg -->
    <script crossorigin src="https://unpkg.com/webex@^1/umd/webex.min.js"></script>

    <!-- via jsdelivr -->
    <script crossorigin src="https://cdn.jsdelivr.net/npm/webex/umd/webex.min.js"></script>
  </head>
  <!-- ...application html... -->
</html>

It is recommended to visit our Getting Started with Browser Usage guide for the most up-to-date documentation on consuming the Webex JS SDK via our CDN within a browser.

Updating the Modules

Since this mono-repository includes a collection of packages that rely on each other to work as intended, it is best to utilize a static version of the Webex JS SDK modules consumed by your application. The best way to do this is by utilizing our helper package: @webex/package-tools.

# using NPM
npm install --dev @webex/package-tools

# using Yarn
yarn add --dev @webex/package-tools

After installation, the following script should be added to your ./package.json for execution:

{
  /* ... */
  "scripts": {
    /* ... */
    "update:sdk": "webex-package-tools update --tag {target-dist-tag} --packages {...packages-to-update}"
  }
}

The above executable accepts a distribution tag, which will match an available tag from the current tags section of NPMJS as well as a list of packages that should be updated when the command executes (this will collect the latest synced version). It is recommended to provide the --packages argument with the complete list of @webex-scoped packages your project consumes in order to promote well-synchronized versions between all packages.

The @webex/package-tools package contains a collection of helpful tools used to manage packages within this project from both within and outside of this project. Please review the documentation associated with the @webex/package-tools package for more information.

Running and Viewing Samples

Sample code can be found within the samples documentation folder. You can preview the contents of this folder by navigating to https://webex.github.io/webex-js-sdk/samples/ or by building them locally. Please see our contributing guide for more information.

Contribute

For detailed instructions on how to contribute, please refer to the contributing guide.

Issues

Please reach out to our developer support team in regards to any issues you may be experiencing within the Webex JS SDK.

Maintainers

This project is maintained by Cisco Webex for Developers.

License

See our license for more information.

webex-js-sdk's People

Contributors

1231varun avatar aarcher11 avatar adamweeks avatar aimeex3 avatar arun3528 avatar bbender avatar buckrivard avatar bzang avatar chrisadubois avatar coread avatar decryan avatar gannons avatar good-joe avatar holsted avatar ianwremmel avatar interactivetimmy avatar jdaly13 avatar jpjpjp avatar kesari3008 avatar lalli-flores avatar marcin-bazyl avatar mattnorris avatar meta-dipanshu-sharma avatar mkesavan13 avatar nickclar avatar saurjai3 avatar shnaaz avatar sreenara avatar taymoork2 avatar tran2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webex-js-sdk's Issues

bin-sauce-connect needs to wait for pid file to disappear

When sc fails to connect due to timeout, it seems the next two attempts fail because the pid file is still hanging around. We need to make sure the next connect doesn't start until the pid file is gone (and maybe make sure to cleanup the pid file)

Document spark.request

spark.request is defined in a package that doesn't currently get picked up by the doc generator

Unify events libraries

SDK source code uses ampersand-events and the node events shim. There's a reasonable good chance there's a library that pulls in EventEmitter2. In browsers in particular, it would be handy if all the needs addressed by these disparate libraries could be handled by just one to reduce bundle size. Perhaps some combination of webpack and a wrapper around ampersand-events could take care of this need.

task "npm run grunt:package -- test" fails

Here's the result after running the command line:

$ PACKAGE=plugin-mercury npm run grunt:package -- test:node

> [email protected] pregrunt:package /Users/tratu/projects/repo/ciscospark
> npm run check-package


> [email protected] check-package /Users/tratu/projects/repo/ciscospark
> if [ -z ${PACKAGE+x} ]; then echo 'environment variable PACKAGE must be defined' && exit 1; fi


> [email protected] grunt:package /Users/tratu/projects/repo/ciscospark
> grunt --gruntfile Gruntfile.package.js "test:node"

Running "env:default" (env) task

Running "env:secrets" (env) task

Running "mochaTest:integration" (mochaTest) task
Warning: init callback must be a function Use --force to continue.

Aborted due to warnings.


Execution Time (2016-08-08 13:08:18 UTC-7)
loading tasks          555ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 88%
env:default              7ms  ▇ 1%
mochaTest:integration   68ms  ▇▇▇▇▇▇▇▇ 11%
Total 633ms


npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/Users/tratu/.npm-packages/bin/npm" "run" "grunt:package" "--" "test:node"
npm ERR! node v5.8.0
npm ERR! npm  v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] grunt:package: `grunt --gruntfile Gruntfile.package.js "test:node"`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] grunt:package script 'grunt --gruntfile Gruntfile.package.js "test:node"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spark-js-sdk package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt --gruntfile Gruntfile.package.js "test:node"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spark-js-sdk
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spark-js-sdk
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tratu/projects/repo/ciscospark/npm-debug.log

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/Users/tratu/.npm-packages/bin/npm',
1 verbose cli   'run',
1 verbose cli   'grunt:package',
1 verbose cli   '--',
1 verbose cli   'test:node' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pregrunt:package', 'grunt:package', 'postgrunt:package' ]
5 info lifecycle [email protected]~pregrunt:package: [email protected]
6 verbose lifecycle [email protected]~pregrunt:package: unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]~pregrunt:package: PATH: /Users/tratu/.npm-packages/lib/node_modules/npm/bin/node-gyp-bin:/Users/tratu/projects/repo/ciscospark/node_modules/.bin:/usr/local/bin:/Users/tratu/.npm-packages/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/bin/jamf:/Users/tratu/.npm-packages/bin:/Users/tratu/.npm-packages/bin
8 verbose lifecycle [email protected]~pregrunt:package: CWD: /Users/tratu/projects/repo/ciscospark
9 silly lifecycle [email protected]~pregrunt:package: Args: [ '-c', 'npm run check-package' ]
10 silly lifecycle [email protected]~pregrunt:package: Returned: code: 0  signal: null
11 info lifecycle [email protected]~grunt:package: [email protected]
12 verbose lifecycle [email protected]~grunt:package: unsafe-perm in lifecycle true
13 verbose lifecycle [email protected]~grunt:package: PATH: /Users/tratu/.npm-packages/lib/node_modules/npm/bin/node-gyp-bin:/Users/tratu/projects/repo/ciscospark/node_modules/.bin:/usr/local/bin:/Users/tratu/.npm-packages/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/bin/jamf:/Users/tratu/.npm-packages/bin:/Users/tratu/.npm-packages/bin
14 verbose lifecycle [email protected]~grunt:package: CWD: /Users/tratu/projects/repo/ciscospark
15 silly lifecycle [email protected]~grunt:package: Args: [ '-c', 'grunt --gruntfile Gruntfile.package.js "test:node"' ]
16 silly lifecycle [email protected]~grunt:package: Returned: code: 3  signal: null
17 info lifecycle [email protected]~grunt:package: Failed to exec grunt:package script
18 verbose stack Error: [email protected] grunt:package: `grunt --gruntfile Gruntfile.package.js "test:node"`
18 verbose stack Exit status 3
18 verbose stack     at EventEmitter.<anonymous> (/Users/tratu/.npm-packages/lib/node_modules/npm/lib/utils/lifecycle.js:245:16)
18 verbose stack     at emitTwo (events.js:100:13)
18 verbose stack     at EventEmitter.emit (events.js:185:7)
18 verbose stack     at ChildProcess.<anonymous> (/Users/tratu/.npm-packages/lib/node_modules/npm/lib/utils/spawn.js:24:14)
18 verbose stack     at emitTwo (events.js:100:13)
18 verbose stack     at ChildProcess.emit (events.js:185:7)
18 verbose stack     at maybeClose (internal/child_process.js:850:16)
18 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
19 verbose pkgid [email protected]
20 verbose cwd /Users/tratu/projects/repo/ciscospark
21 error Darwin 15.6.0
22 error argv "/usr/local/bin/node" "/Users/tratu/.npm-packages/bin/npm" "run" "grunt:package" "--" "test:node"
23 error node v5.8.0
24 error npm  v3.9.6
25 error code ELIFECYCLE
26 error [email protected] grunt:package: `grunt --gruntfile Gruntfile.package.js "test:node"`
26 error Exit status 3
27 error Failed at the [email protected] grunt:package script 'grunt --gruntfile Gruntfile.package.js "test:node"'.
27 error Make sure you have the latest version of node.js and npm installed.
27 error If you do, this is most likely a problem with the spark-js-sdk package,
27 error not with npm itself.
27 error Tell the author that this fails on your system:
27 error     grunt --gruntfile Gruntfile.package.js "test:node"
27 error You can get information on how to open an issue for this project with:
27 error     npm bugs spark-js-sdk
27 error Or if that isn't available, you can get their info via:
27 error     npm owner ls spark-js-sdk
27 error There is likely additional logging output above.
28 verbose exit [ 1, true ]

Error: Cannot find module 'ampersand-collection'

node v6.1.0
npm v3.8.6
on OS X and AWS Elastic Beanstalk Linux

Just updated to 0.6.6 from 0.6.4 and I get this error

module.js:442
    throw err;
    ^

Error: Cannot find module 'ampersand-collection'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/app/current/node_modules/@ciscospark/plugin-wdm/dist/device/feature-collection.js:7:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

Remove old examples

examples and example-postman are remnants of the legacy sdk and misleading; remove them

bundled JS Spark not working in Firefox. Does work in Chrome but bad quality

we are still working on our web implementation of Spark video calling.
In Chrome 52.0 we have an Angular2 app and a plain html page working with an bundled Spark JS file.
The video quality is bad.
With the Cisco demo app the video quality is fine.

With Firefox 48.0 both the Angular2 app and the plain html page won't work.
So right now the video quality is untestable.

The Firefox browser doesn't get all events and also complaints about the remoteMediaStreamUrl.

The spark.js is generated with:
export CISCOSPARK_CLIENT_ID=xxxxx
export CISCOSPARK_CLIENT_SECRET=xxxxx
export CISCOSPARK_SCOPE='spark:messages_write spark:rooms_read spark:teams_read spark:memberships_read spark:messages_read spark:rooms_write spark:people_read spark:team_memberships_write spark:team_memberships_read spark:teams_write spark:memberships_write'
export CISCOSPARK_REDIRECT_URI=http://localhost:5555/

npm install -g browserify
npm install -g uglify-js

npm install
npm run bootstrap
npm run build
browserify --standalone ciscospark packages/ciscospark > spark.js

npm install failing

$ npm install ciscospark seems to be failing for myself and a colleague, giving:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/bin/npm" "install" "--save" "ciscospark"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.5

npm ERR! No compatible version found: @ciscospark/spark-core@^0.7.0-alpha.f22f099e
npm ERR! Valid install targets:
npm ERR! 0.7.0-alpha.ce9393d4, 0.7.0-alpha.a5bc0482, 0.7.0-alpha.3266717c, 0.6.9, 0.6.6, 0.6.4, 0.6.3, 0.6.1, 0.6.0, 0.6.0-35, 0.6.0-34
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rilogan/Projects/SparkVideo/npm-debug.log

$ npm view @ciscospark/plugin-phone versions doesn't seem to show the asked for 0.7.0-alpha.f22f099e version.

For the record, $ npm install [email protected] works fine.

Manual testing is too inconvenient

Current options are

PACKAGE=ciscospark npm run grunt:package -- build test --grep "name of my unit test"

or

  1. Replace main for package under test with src isntead of dist

  2. run package tests:

    PACKAGE=ciscospark npm run test:package -- --grep "name of my unit test"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.