Reputation: 6299
How can I access capsule-specific information in Javascript code?
I want to include my capsule id and version in a User-Agent when communicating with my backend. Ideally I would also be able to get the Bixby version and Android version my capsule is running on. I'm hoping there's something like $vivContext
which I can just hand over to my Javascript code.
Upvotes: 1
Views: 389
Reputation: 1501
You are correct that $vivContext
does NOT hold capsule id or version. There is also no build-in for fetching content of capsule.bxb yet.
However, you can use config API.
After defining capusleID
and version
property of your capsule in term & capsules section in developer center, you can use the following code in your JS file.
var config = require('config');
var myID = config.get('capsuleID');
var myVersion = config.get('version');
Upvotes: 1