Module: NexusConnectSDK

NexusConnectSDK global namespace

Version:
  • 2.1

Namespaces

chat

Methods


<static> category(type, options)

This API makes a request to server to return category list or guide list within the selected categories based on the type of category request. This method can be invoked after SDK Initialize API call.

Parameters:
Name Type Description
type string

Type of category request

Possible values are:

  • fetch - Returns the category list.
  • select - Returns list of GPs within the selected category.

options object

Optional json object.

Possible values are:

  • language_code - language code. Default is 'en'.
  • category_id - selected category id for which GPs would be returned (Works only with type 'select').

Returns:

Promise for the request.

Type
promise

<static> clearContext()

Clears any previously stored data except any user identity information and theme customizations.


<static> clearIdentity()

Clears any previously stored consumer identity information


<static> cloudSearch(type, input_text, options)

This API makes a search request based on type of search request. This method can be invoked after SDK Initialize API call.

Parameters:
Name Type Description
type string

Type of search.

Possible values are:

  • autocomplete - Returns the autocomplete list.
  • search - Returns the search list based on search text.
  • tags - Returns the path list based on tags.
  • help_id - Returns the path list based on helpid.

input_text string

The input text based on which search results should be returned.

options json

Optional json data.

Possible values are:

  • language_code - language code. Default is 'en'.
  • category_id - category id from where the request is performed.
  • installation_id - unique installation id for the app.

Returns:

Promise for the request.

Type
promise

<static> configuration(type)

Make a request for getting configuration settings from the Support Cloud server.

Parameters:
Name Type Description
type string

Type of log request

Possible values are:

  • hoursOfOperation

Returns:

Promise for the request

Type
promise

<static> connectionCode()

Make a request for getting connection code.

Returns:

Promise for the request

Type
promise

<static> exitHelp()

Ends a live/assisted help session


<static> feedbackCompleted()

Informs selfservice that feedback flow is completed


<static> initialize(apiToken)

Initializes the SDK with the specified API token

Parameters:
Name Type Description
apiToken string

the API token to be used by the SDK


<static> isLiveHelpActive()

Returns whether or not the live/assisted help application is active.

Returns:

true if the live/assisted help application is active; false if not

Type
boolean

<static> log(type, options)

This API makes a request to server for activity logging for feedback. This method can be invoked after SDK Initialize API call.

Parameters:
Name Type Description
type string

Type of log request.

Possible values are:

  • activity_log
  • This data will be logged to activity log and will be used for analytics.
  • action
  • Log a user action on the page. Logged data will be shown under session breadcrumb history.
  • device
  • This data will be available in "User History" Dialog in Support Cloud Agent Portal.
  • data
  • This data will be available in "User History" Dialog in Support Cloud Agent Portal.
  • content
  • This data will be available in "User History" Dialog in Support Cloud Agent Portal.

options json

Optional json data when type is set to activity_log.

Possible values are:

  • session_id
  • session_device_id
  • session_context_id
  • session_workflow_id
  • workflow_version_id
  • session_workflow_step_id
  • workflow_step_uid
  • event
  • Possible values workflow_version_feedback,workflow_version_resolution.
  • source
  • Possible value SelfService.
  • data optional json data.
    • comment
    • rating
    • resolved

Otherwise, optional json data when type is not activity_log.

Possible values are:

  • name
  • string
  • data
  • object

Returns:

Promise for the request.

Type
promise

<static> logAction(name [, data])

Log a user action on the page.

Logged data will be shown under session breadcrumb history.

Parameters:
Name Type Argument Description
name string

the name of the user action

data object <optional>

the data associated with the user action


<static> logContent(name [, data])

Log information about the content

Logged data will be shown under content detail section on agent side.

Parameters:
Name Type Argument Description
name string

the name of content

data object <optional>

the content-specific data to be logged


<static> logDevice(name [, data])

Log information about the device.

Logged data will be shown under device detail section on agent side.

Parameters:
Name Type Argument Description
name string

the name of consumer's device

data object <optional>

the device-specific data to be logged


<static> onBridgeInitialized(cb)

Sets the callback that is invoked when the bridge between the containing application and the self-help application is initialized

Parameters:
Name Type Description
cb bridgeInitializedCallback

Reference to a callback invoked on bridge initialization

Within this callback the following method invocation is advisable to access additional control over the selfservice app.

  • onPathStart
  • onPathSelected
  • onPathEnds
  • onStepChange
  • onSelfserviceViewChange
  • onSelfserviceContainerSizeChange
  • launchFeedback
  • showExitPath
  • requestHandledByApp
  • showFeedbackOnExitPath
  • showFeedbackOnDone
  • feedbackCompleted


<static> onPathEnds(callback)

Sets a callback that is invoked when the guided path ends

Parameters:
Name Type Description
callback function

reference to a callback function invoked when the guided path ends callback has data field consisting of following fields

  • source
  • Possible values feedbackSubmit, feedbackNoThanks, noFeedback, externalFeedback
  • context
  • This json field will have information about the current context of the path
NOTE: When using external feedback, handling should be done only when source is externalFeedback


<static> onPathSelected(cb)

Sets the callback that is invoked when a guided path is selected by the consumer inside the self-help application

Parameters:
Name Type Description
cb pathSelectedCallback

Reference to a callback function invoked when consumer selects a guided path. This callback has following parameters.

  • workflow_version_idId of the published workflow version.


<static> onPathStart(cb)

Sets the callback that is invoked when a guided path is started by the consumer inside the self-help application

Parameters:
Name Type Description
cb pathStarCallback

Reference to a callback function invoked when consumer starts a guided path This callback has following parameters.

  • name Name of the guided path.


<static> onSelfserviceContainerSizeChange(cb)

Sets a callback that is invoked when the self-help application container size changes to help the containing application adjust its size

Parameters:
Name Type Description
cb containerSizeChangeCallback

Reference to a callback function invoked when the self-help application container size changes.

This callback has following parameters.

  • widthContainer width
  • heightContainer height


<static> onSelfserviceViewChange(cb)

Informs that selfservice view has changed

Parameters:
Name Type Description
cb viewChangeCallback

Reference to a callback function invoked when the self-help application view change.

This callback has following parameters.

  • view Current active view

    view object can have the following values:

    • {'currentView': 'HOME'}
    • {'currentView': 'CATEGORY'}
    • {'currentView': 'SEARCH'}
    • {'currentView': 'STEP_NAVIGATION'}


<static> onStepChange(cb)

Informs selfservice that step content has changed

Parameters:
Name Type Description
cb stepChangeCallback

Reference to a callback function invoked when the self-help step changes. This callback has following parameters.

  • stepInfo Current step data


<static> preserveContext(preserve)

Sets whether or not the current context information should be preserved after the self-help API call

Parameters:
Name Type Description
preserve boolean

true if context information should be preserved; false if not


<static> requestHandledByApp(appHandled)

Set whether or not navigation to a guided path is handled by the containing application or the self-help application

Parameters:
Name Type Description
appHandled boolean

true if the containing application will handle guided path navigation; false if not


<static> resetContext()

Clears any previously stored data including any user identity information


<static> setContactUsOptions(options)

Sets contact us options to be used

Parameters:
Name Type Description
options object

the options for contact

Properties
Name Type Description
phone string

the phone number to be displayed to the consumer to dial.

skill string

the required skill of the agent who the support request should be escalated to

remoteConnectionType string

the type of remote control that must be used. Valid values are remote and cobrowse. Default is remote


<static> setCustomizationOptions(options)

Sets the options of customizing the self-help or live-help

Parameters:
Name Type Description
options object

the customization options

Properties
Name Type Description
themeUrl string

URL to the custom theme CSS file

stepContentThemeUrl string

URL to the custom theme CSS file for step content


<static> setData(param)

Sets custom data to be passed to the SDK

Parameters:
Name Type Description
param object

custom data represented as key-value pairs


<static> setDisplayOrder(displayOrder)

Set the display order of widgets displayed in self-help

Parameters:
Name Type Description
displayOrder Array.<string>

An array of widget names in the required display order.

Possible values are:

  • search - the search widget
  • categories - the category cards widget
  • paths - the recommended paths widget
  • contact_us - the contact us widget with the call and chat buttons as configured

When displayOrder is not set or null is passed as the value, then all the widgets are displayed in the order of search, categories, paths and contact_us


<static> setEmail(emailAddress)

Sets the e-mail address the consumer to the specified address

Parameters:
Name Type Description
emailAddress string

the e-mail address of the consumer to be set


<static> setExternalId(externalId)

Sets an external ID of the consumer to the specified ID

Parameters:
Name Type Description
externalId string

the external ID of the consumer to be set


<static> setFirstName(firstName)

Sets the first name of the consumer to the specified name

Parameters:
Name Type Description
firstName string

the first name of the consumer


<static> setLanguage(languageCode)

Sets the language code to be used by the self-help and live-help application

Parameters:
Name Type Description
languageCode string

iso language code representing the language to be used


<static> setLastName(lastName)

Sets the last name of the consumer to the specified name

Parameters:
Name Type Description
lastName string

the last name of the consumer to be set


<static> setPhone(phoneNumber)

Sets the phone number of the consumer to the specified number

Parameters:
Name Type Description
phoneNumber string

the phone number of the consumer to be set


<static> showExitPath(showExit)

Set whether or not the exit path button is displayed inside the self-help application

Parameters:
Name Type Description
showExit boolean

true if the exit path button must be displaed inside the self-help application; false if not


<static> showFeedbackOnDone(showFeedback)

Set whether or not the feedback prompt must be displayed by the self-help application on done

Parameters:
Name Type Description
showFeedback string

yes shows selfservice feedback dialog on Done; no hides selfservice feedback dialog on Done. external hides selfservice feedback dialog on Done and wait for feedbackCompleted call


<static> showFeedbackOnExitPath(showFeedback)

Set whether or not the feedback prompt must be displayed by the self-help application on exit

Parameters:
Name Type Description
showFeedback boolean

true if the feedback prompt has to be shown; false if not


<static> showLiveHelp(element, options)

Brings up the Assisted Support Screen.

Creates iframe which can be appended to an element within dialog box that overlays over a small area of the screen.

Parameters:
Name Type Description
element DOMElement

An optional container for assisted support screen.

options object

options to configure the live-help

Properties
Name Type Description
mode string

what assisted help options are available to the consumer. Valid values are call and chat and "" for both. Default is both.

phone string

Live Help phone number. Calling card number if configured is used as default.

skill string

Name of skill for queueing chat. If no skill is passed, mode is set to call.

remoteConnectionType string

the type of remote control that must be used. Valid values are remote and cobrowse. Default is remote


<static> showSelfHelpForFamilyBrandModel(family, brand, model [, element])

Loads the self-help application for the content with the specified tags.

Parameters:
Name Type Argument Description
family string

the family attribute of the self-help content to load

brand string

the brand attribute of the self-help content to load

model string

the model attribute of the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.


<static> showSelfHelpForId(helpId [, element])

Loads the self-help application for the content with the specified help ID.

Parameters:
Name Type Argument Description
helpId string

the help ID of the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.


<static> showSelfHelpForPathId(the [, element])

Loads the self-help application for the content with the specified path version id.

Parameters:
Name Type Argument Description
pathVersionId string

path version id of the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.


<static> showSelfHelpForSearch(searchTerm [, element])

Loads the self-help application for the content with the specified search term.

Parameters:
Name Type Argument Description
searchTerm string

the search term used to query the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.


<static> showSelfHelpForTags(tags [, element])

Loads the self-help application for the content with the specified tags.

Parameters:
Name Type Argument Description
tags Array.<string>

an array containing the tags of the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.


<static> showSelfHelpForWorkflow(pathId [, element])

Loads the self-help application for the content with the specified path id.

Parameters:
Name Type Argument Description
pathId string

the path id of the self-help content to load

element DOMElement <optional>

an optional reference to a DOMElement into which the self-help application should load. If not specified, the self-help application is loaded into the body of the page.