Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

ciscospark

1.32.23 • Public • Published

ciscospark

standard-readme compliant

The Cisco Webex JS SDK

Install

npm install --save ciscospark

Usage

See the docs site for more examples.

const assert = require(`assert`);
assert(process.env.CISCOSPARK_ACCESS_TOKEN, 'This example assumes you have set your access token as an environment variable');
const ciscospark = require(`ciscospark`);
ciscospark.rooms.create({title: `My First Room`})
  .then((room) => {
    return Promise.all([
      ciscospark.memberships.create({
        roomId: room.id,
        personEmail: `alice@example.com`
      }),
      ciscospark.memberships.create({
        roomId: room.id,
        personEmail: `bob@example.com`
      }),
    ])
      .then(() => ciscospark.messages.create({
        markdown: `**Hi Everyone**`,
        roomId: room.id
      }));
  });

In Browser

We do not provide a prebuilt version of ciscospark.

If you've already got a commonjs or es6 build process in place, you can simply use const ciscospark = require('ciscospark').

If you need to load ciscospark via a script tag, you'll need to build it:

npm install ciscospark
npm install -g browserify
echo "window.ciscospark = require('ciscospark')" > ./index.js
browserify index.js > bundle.js

In either case above, you must set the following environment variables

  • CISCOSPARK_CLIENT_ID
  • CISCOSPARK_CLIENT_SECRET
  • CISCOSPARK_SCOPE
  • CISCOSPARK_REDIRECT_URI

In browser usage is pretty much the same as node usage, with the addition of handling the login flow for you. See the docs site for more details.

API

Full API docs are published at the docs site.

Maintainers

This package is maintained by Cisco Webex for Developers.

Contribute

Pull requests welcome. Please see CONTRIBUTING.md for more details.

License

© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.

Keywords

none

install

npm i ciscospark

Downloadsweekly downloads

4,760

version

1.32.23

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability