Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (60 sloc) 2.98 KB
<!DOCTYPE html>
<title>Sample: Socket</title>
<link rel="stylesheet" href="">
<div class="container">
<div class="columns">
<div class="column col-12">
<h2>Listen to socket events in the browser.</h2>
<p>Initialize the SDK with <a target="_blank" href="">Your Personal Access Token</a>.</p>
<form class="form-group" id="credentials">
<label class="form-label" for="access-token">Your Personal Access Token</label>
class="column col-8"
placeholder="Your Personal Access Token"
type="text" />
<button class="btn" id="connect" title="connect" type="submit">Initialize</button>
<p class="label label-warning" id="connection-status">not initialized</p>
<p>Open this browser's <em>inspection tools</em> to view the <em>console</em>.</p>
After this app initializes it calls the <em>listen()</em> function on the SDK's <em>message,
membership, and rooms</em> objects, and registers handlers for the events. These handlers simply
log the content of the events in the console window. To see this activity, open
<a href="" target="_blank">a Webex Teams client</a> and
create rooms, memberships or messages.
These activities will generate an event which will fire and display in the console.
See the Webex <a href="">Webhook Documentation</a>
for more information on the payloads of the membership, message and room events. In general
the SDK events closely match the payload of the webhooks, except in cases where the information
in a traditional webhook envelope doesn't make sense, for example there is no <em>name, targetUrl</em>, or
<em>secret</em> field in the SDK event envelopes.
The SDK adds one event which is not yet supported in the webhooks. A <em>memberships:seen</em> event
is generated when a Webex client sends a "read receipt". The <em>membership:seen</em> event will include a
<em>lastSeenId</em> field with the id of the last message read by the user.
View the <a href="./app.js">
source for this app</a>
<!-- /bundle.js is the bundled Webex JavaScript SDK -->
<script src="/bundle.js"></script>
<!-- app.js is your application code -->
<script src="app.js"></script>
You can’t perform that action at this time.