Comment on page
API Reference
Agent SDK API reference
The Cobrowse Agent SDK provides a way to interact with the Cobrowse APIs for a variety of use cases. Primarily this library is designed for building a fully white-labeled version of Cobrowse, including custom user interfaces and styling to match your own platform.
The library can be used either from the browser (most common), or a NodeJS environment. Note: not all APIs are available when used in NodeJS.
EventEmitter
↳default
• new default(
token?
, options?
)Create a new Agent SDK instance. An instance encapsulates information about your API location (if using the self-hosted Cobrowse Enterprise option), and optionally, the authorization token for the agent using the SDK.
Options
api
- The url for an Enterprise Cobrowse instance. You do not need to configure this when using our global hosted service.const token = await myJWTGeneratingFunction()
const cobrowse = new CobrowseAPI(token, { api: 'https://cobrowse.example.com' })
Parameters
Name | Type | Description |
---|---|---|
token? | string | |
options? | Record <string , any > | Options for configuring this instance of CobrowseAPI. |
Overrides
EventEmitter.constructor
•
get
api(): string
The url for the Cobrowse instance.
Returns
string
•
get
devices(): DevicesAPI
Namespace API for devices. A device in Cobrowse is how a single instance of an app or website is tracked by Cobrowse.
Returns
DevicesAPI
•
get
license(): string
The license key for the Cobrowse account. This uniquely identifies your account within Cobrowse, you may choose to have different license keys for development, test, and production environments.
Returns
string
•
set
license(license
): void
The license key for the Cobrowse account. This uniquely identifies your account within Cobrowse, you may choose to have different license keys for development, test, and production environments.
Parameters
Name | Type |
---|---|
license | string |
Returns
void
•
get
recordings(): SessionRecordingAPI
Namespace API for recordings. A recording in Cobrowse represents the video and event metadata for a recorded session.
Returns
SessionRecordingAPI
•
get
sessions(): SessionsAPI
Namespace API for sessions. A session in Cobrowse represents a single screensharing activity with an agent.
Returns
SessionsAPI
•
get
token(): string
The JWT for API authorization. This token should be securely generated by your backend to authorize use of the Cobrowse APIs.
Returns
string
•
set
token(token
): void
The JWT for API authorization. This token should be securely generated by your backend to authorize use of the Cobrowse APIs.
Parameters
Name | Type |
---|---|
token | string |
Returns
void