Uh oh! We couldn’t find any match.

Please try other search keywords.

Bixby Developer Center

Guides

User Context

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

Download Capsule

Execute the following intent:

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 {
none
}
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) {
console.log($vivContext);
return $vivContext.locale;
}