Bixby Developer Center

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 namespace 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:

// Request access to the $vivContext by declaring it as a parameter
export default function accessVivContext({ $vivContext }) {
return JSON.stringify($vivContext, undefined, 1);
}

View master on GitHub

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

  permissions {
bixby-user-id-access
}

View dcf6232 on GitHub

Video Tutorial: Get User Information in a Bixby Capsule

The following video tutorial describes several ways to use the $vivContext variable with the user-context sample capsule.