Personalizing your capsule experience is a great way of providing your users with the most relevant content. $vivContext is the way you can access user-specific information for your capsule to use during runtime.
The information contained within $vivContext provides you with user-specific details. Here are the important items that may be helpful:
locale: This is the user's region/locale as defined by the IETF BCP 47 language tag. Example:
timezone: This is the user's time zone as per the tz database. Example:
accessToken: This is the user's Auth access token (used with Endpoints).
sessionId: This is a unique identifier for a specific conversation by a specific user. You can pass the sessionID through your external system to track that different requests are from the same conversation by the same user.
testToday: This is the time in milliseconds that was set by the Simulator using the GPS/Clock Override section within User settings. Note:
testTodayis never actually present in a request from an actual Bixby-enabled device.
device: This is the device class ID. Examples include
bixby-tv. This property is useful, for example, if you are developing for multiple devices and need to display different content depending on
canTypeId: This is the CAN type ("target") in which the execution is taking place. Example:
handsFree: This is a boolean indicating whether the user is using the device in a hands-free mode. On a speaker, this is always true.
storeCountry: This is the store country specified by the client, denoted in ISO 3166-1 alpha-2. Example:
deviceModel: This is the specific device model of the client. Example:
grantedPermissions: This contains the dictionary of permissions granted by the user for the top level capsule.
is24HourFormat: This is a boolean indicating whether the device is set to display time in 24-hour format (
true) or AM/PM format (
networkCountry: This is the country of the device's current network, denoted in ISO 3166-1 alpha-2. Example:
bixbyUserId: This is a secure user ID that can be used to persist user state or implement analytics. This ID is tied to the user's account and will be the same across all devices. Note: A user can request a new one from Samsung at any time if they wish to. It is best to not use this as an identifier for persisting data on your end.