SDK Functions
Here's a list of all the functions supported by UserView's SDK. These can be called with Upscope('FUNCTION_NAME', ...args);
.
Function Name | Arguments | Description |
---|---|---|
cancelRequestAgent |
— | Stops an Agent request. |
connect |
— | Starts the socket connectionⓘ to the UserView servers. |
getLookupCode |
(callback: function(code: 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) ⓘ |
Used to initiate UserView. This must be the first function called. |
newPageview |
— | Triggers a new pageview in a SPA environment. |
on |
(...events: string, callback: function) |
Adds a listener for the events provided. |
requestAgent |
— | Initiates an Agent request. |
reset |
(reopenConnection: true) |
Used to reset the connection with UserView 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 UserView will be in its initial idle state. |
prefetchAssets |
— | Call if you know a Session is about to happen to start prepping for it and make it go live faster. |
stopSession |
— | Terminates an active Session. |
submitRating |
(ratings: { userSessionRating?: ⓘ integer, userAgentRating: ⓘ integer, userAgentFeedback: string) |
Submits a user rating after a Session has ended. |
updateConnection |
(updates: {uniqueId?: string, identities?: 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. |