Webex Teams

SDK for JavaScript

Integrate Webex Teams calling into your JavaScript applications quickly


Integrate the JavaScript SDK in both Node.js and client-side applications. Place and receive video calls via the SDK:

  • Audio and/or video 1:1 calling
  • Dial by email or SIP address
  • Call and event controls
  • Audio and video call control
Getting Started Guide

In this example, we'll use Node.js to create a simple project that will post a message to a room.


  • Create a Webex Teams Room
  • Post a Message


  • Node.js LTS 6.x and later, npm 3.x and later
  • Optionally: nvm to manage Node.js versions
  • Supported Browsers: Google Chrome (latest) or Mozilla Firefox (latest) for calling features
  • This SDK requires the spark:all scope

Step 1: Create the Project Directory

cd /my/project/directory
npm init

You’ll be prompted to answer a few simple questions, but typically the defaults are just fine.

Step 2: Install the JavaScript SDK

Now, install ciscospark:

npm install --save ciscospark

Step 3: Start Using the SDK

So, you want to send a message. First, you need an access token. For demonstration purposes, we’ll use environment variables to authorize the SDK. If you're logged into this site, you can see your token by clicking on your avatar in the top right corner of this page. If not, log in or sign up to get your access token.

Create a new file in your project directory named index.js and add the following to it:

var spark = require('ciscospark/env');
  title: 'My First Room!'
  // Make sure to log errors in case something goes wrong.
  .catch(function(reason) {

Now, open the Webex Teams Web Client to you see your code in action. Then, back in your terminal, run the following command:


Check out the web client. You should see your new room. Now, let’s send a message to it.

Open up index.js again and replace its contents with the following code:

var spark = require('ciscospark/env');
  max: 10
  .then(function(rooms) {
  var room = rooms.items.filter(function (room) {
    return room.title === 'My First Room!';

  return spark.messages.create({
    text: 'Hello World!',
    roomId: room.id
// Make sure to log errors in case something goes wrong.
.catch(function(reason) {

Run it again with the following:


Now check out the web client. Congrats! You’ve sent your first message!