
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
ciscospark
Advanced tools
The Cisco Webex JS SDK
npm install --save ciscospark
To use the SDK, you will need Cisco Webex credentials. If you do not already have a Cisco Webex account, visit Cisco Webex for Developers to create your account and retrieve your access token.
See the detailed docs for more usage examples.
const ciscospark = require(`ciscospark`);
const teams = ciscospark.init({
credentials: {
access_token: <your webex teams access token>
}
});
// Create a room with the title "My First Room"
// Add Alice and Bob to the room
// Send a **Hi Everyone** message to the room
teams.rooms.create({ title: `My First Room` }).then(room => {
return Promise.all([
teams.memberships.create({
roomId: room.id,
personEmail: `alice@example.com`
}),
teams.memberships.create({
roomId: room.id,
personEmail: `bob@example.com`
})
]).then(() =>
teams.messages.create({
markdown: `**Hi Everyone**`,
roomId: room.id
})
);
});
We do provide a built, minified version of the SDK that includes window.ciscospark
which is hosted on our repo and can be used with gitcdn.xyz.
<script src="https://gitcdn.xyz/repo/webex/spark-js-sdk/master/packages/node_modules/ciscospark/umd/ciscospark.min.js"></script>
We do not provide a built version of the SDK that includes window.ciscospark
.
In-browser usage is almost the same as Node.js, but it handles the user authentication flow for you. See the browser guide for more information.
If you're already using a bundler (like Webpack or Rollup) you can simply import/require the package and use the above snippet and assign the initialized team
variable to window.webexteams
.
For a quick example, we'll use Parcel to bundle the SDK for a website. For any more information and questions on how to use Parcel, please head to their website.
index.js
.import { init as initTeams } from 'ciscospark';
// Initialize the SDK and make it available to the window
const teams = (window.webexteams = initTeams({
credentials: {
access_token: <your webex teams access token>
}
}));
// Create a room with the title "My First Room"
teams.rooms
.create({
title: 'My First Room!'
})
.catch((error) => {
console.error(error);
});
// Filter for "My First Room" from the last 10 rooms
teams.rooms
.list({
max: 10
})
.then((rooms) => {
// Destructure room properties for its id (aliased to roomId) and title
const { id: roomId, title } = rooms.items.filter(
room => room.title === 'My First Room!'
)[0];
// Post message "Hello World!" to "My First Room!"
teams.messages.create({
roomId,
text: 'Hello World!'
});
// Log the the room name and the message we created
return teams.messages
.list({ roomId, max: 1 })
// Destructure promised value to get the text property from the first item in items array
.then(({ items: [{ text }] }) =>
console.log(`Last message sent to room "${title}": ${text}`)
);
})
.catch((error) => {
console.error(error);
});
index.html
.<html>
<head>
<title>Webex SDK for Browsers</title>
</head>
<body>
<script src="./index.js"></script>
</body>
</html>
parcel index.html
in your terminal.ciscospark/env
?Full API docs are published at the docs site.
This package is maintained by Cisco Webex for Developers.
Pull requests welcome. Please see CONTRIBUTING.md for more details.
© 2016-2018 Cisco and/or its affiliates. All Rights Reserved.
FAQs
SDK for Cisco Webex
The npm package ciscospark receives a total of 1,966 weekly downloads. As such, ciscospark popularity was classified as popular.
We found that ciscospark demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.