Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Upgrading from CiscoSpark to Webex?
npm install --save webex
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 Webex = require(`webex`);
const webex = Webex.init({
credentials: {
access_token: <your webex 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
webex.rooms.create({ title: `My First Room` }).then(room => {
return Promise.all([
webex.memberships.create({
roomId: room.id,
personEmail: `alice@example.com`
}),
webex.memberships.create({
roomId: room.id,
personEmail: `bob@example.com`
})
]).then(() =>
webex.messages.create({
markdown: `**Hi Everyone**`,
roomId: room.id
})
);
});
We provide a built, minified version of the SDK, that includes window.Webex
. You can access it via unpkg or jsdelivr.
<!-- unpkg -->
<script src="https://unpkg.com/webex/umd/webex.min.js"></script>
<!-- jsdelivr -->
<script src="https://cdn.jsdelivr.net/npm/webex/umd/webex.min.js"></script>
If you're already using a bundler (like Webpack) you can simply import/require the package and use the above snippet and assign the initialized webex
variable to window.webex
.
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 initWebex } from 'webex';
// Initialize the SDK and make it available to the window
const webex = (window.webex = initWebex({
credentials: {
access_token: <your webex access token>
}
}));
// Create a room with the title "My First Room"
webex.rooms
.create({
title: 'My First Room!'
})
.catch((error) => {
console.error(error);
});
// Filter for "My First Room" from the last 10 rooms
webex.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!"
webex.messages.create({
roomId,
text: 'Hello World!'
});
// Log the the room name and the message we created
return webex.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.webex/env
or 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-2020 Cisco and/or its affiliates. All Rights Reserved.
FAQs
SDK for Cisco Webex
The npm package webex receives a total of 3,966 weekly downloads. As such, webex popularity was classified as popular.
We found that webex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.