SDK Functions
Here's a list of all the functions supported by Upscope's SDK.
These can be called with Upscope('FUNCTION_NAME', ...args);
.
Function name | Arguments | Description |
---|---|---|
cancelRequestAgent |
— | Stops and Agent request. |
connect |
— | Starts the socket connection to the Upscope servers.1 |
getLookupCode |
(callback: function(link: string)) |
Returns the lookup code through the callback. |
getLookupCode |
(callback: function(link: string)) |
Returns the lookup code through the callback. |
getShortId |
(callback: function(shortId: string)) |
Returns the Visitor's shortId through the callback. |
getWatchLink |
(callback: function(link: string)) |
Returns the watch link through the callback. |
init |
(configuration: dictionary) 2 |
Used to initiate Upscope. This must be the first function called. |
logEvent |
(eventType: string, eventMessage: string) |
Logs a new event in the history of the visitor. eventType must be one of success , error , info , warn , contact . |
newPageview |
— | Triggers a new pageview in a SPA environment. |
on |
(...events: string, callback: function) |
Adds a listener for the events provided. |
redirect |
(url: string) |
If a Session is active, it will redirect the visitor to the provided URL through the Upscope proxy, otherwise it will send the visitor directly to the URL. |
requestAgent |
— | Initiates an Agent request. |
reset |
(reopenConnection: true) |
Used to reset the connection with Upscope and clear all identity from the Visitor. A new Visitor will be generated with a fresh ID. If reopenConnection is false , the connection will not be automatically re-opened, and Upscope will be in its initial idle state. |
saveHistory |
— | Persists the visitor's history and screenshots to Upscope's servers. |
stopSession |
— | Terminates an active Session. |
submitRating |
(ratings: dictionary) 4 |
Submits a user rating after a Session has ended.5 |
updateConnection |
(updates: list, uniqueId: string, tags: string, integrationIds: string, callName: string, agentPrompt: string, allowRemoteConsole: boolean, allowRemoteClick: boolean, allowRemoteScroll: boolean, allowRemoteType: boolean, allowAgentRedirect: boolean) |
Used to update the identity of the visitor or settings after pageload.3 |
-
This is only needed if
autoconnect
isfalse
. ↩ -
Only
identities
,uniqueId
,tags
, andagentPrompt
are allowed. ↩ -
Accepted keys are
userSessionRating
(integer
between 0 and 5—used to rate the quality of the Session),userAgentRating
(integer
between 0 and 5—used to rate the quality of the service provided by the agent), anduserAgentFeedback
(string
—used for feedback about the agent). ↩ -
Calling this method before a Session has ended will have no effect. ↩