Bixby Developer Center

Guides

User Context

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

Download Capsule

Note

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.

After you compile the NL, you can run this query in the Simulator to see the value of $vivContext: "Show user context".

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

// code/AccessVivContext.js

module.exports.function = function accessVivContext ($vivContext) {
return JSON.stringify($vivContext, undefined, 1);
}

$vivContext.bixbyUserId will be null by default. In order to access the value, you must request this permission:

// capsule.bxb

permissions {
  bixby-user-id-access
}