Class: LiveContextAttributes

LiveContextAttributes

Context attributes used by Live Experience component.
Additional (internal) context attributes are added by the component, such as devType, devDesc, osVersion, appVersion. "appLocation" (if specified) is used to match on engagement scenario name.
The default engagement scenario "appLocation" values are:
  • Basic Guidance
  • Remote Support
  • Collaboration
  • Personal Shopper
  • Concierge
  • Know Your Customer
  • Short Code
See:
Example
liveApi.controller.contextAttributes.set("appLocation", "Basic Guidance");
liveApi.controller.contextAttributes.set("fullName", "Macy Williams");
liveApi.controller.contextAttributes.set("email", "macy.williams@example.com");
liveApi.controller.contextAttributes.set("phone", "+16505550121");
liveApi.controller.contextAttributes.set("location",
                                         "San Francisco CA, United States");

Methods

get(key) → {string}

Get the context attribute value for the given key.
Parameters:
Name Type Description
key string the context key.
Returns:
the context value.
Type
string

remove(key)

Remove an attribute from the context.
Parameters:
Name Type Description
key string the context key to remove

removeAll()

Remove all of the context attributes.

set(key, value)

Set the context attribute key to a value.
Parameters:
Name Type Description
key string the context key.
value string the context value.