Bixby Developer Center


User Context

This sample capsule is a quick demonstration of the $vivContext variable for passing user context information.

Download Capsule


Because you cannot submit a capsule with the example namespace, in order to test a sample capsule on a device, you must change the id in the capsule.bxb file from example to your organization's before making a private submission.

For example, if your namespace is acme, change example.vivContext to acme.vivContext.

Execute the following intent in the Simulator:

intent {
goal: AccessVivContext

The AccessVivContext model outputs the locale information from $vivContext. Its implementation, code/AccessVivContext.js, also logs the entire $vivContext structure to the console. To view it, open the Functions inspector in the Debug Console, and select "Logs".

To use $vivContext, declare it as an accepted input to the local endpoint:

// resources/base/vivContext.endpoints.bxb

endpoints {
authorization {
action-endpoints {
action-endpoint (AccessVivContext) {
accepted-inputs (dummyInput, $vivContext)
local-endpoint ("AccessVivContext.js")

This declaration makes $vivContext available to the JavaScript action implementation as a parameter:

// code/AccessVivContext.js

module.exports.function = function accessVivContext(dummyInput, $vivContext) {
return $vivContext.locale;