Samsung Bixby
This section describes how to integrate a Samsung Bixby capsule with Botanalytics.
This section is designed for the the latest version of Botanalytics, which is currently on private beta.
If you would like to join the beta and use the latest version of Botanalytics, follow the instructions.
Prerequisites
A Samsung Bixby capsule that:
- Uses JavaScript Runtime Version 2
- Has
bixby-user-id-access
permission - Is registered on the Samsung Bixby Developer Console (for setting configurations and secrets)
Integration
Copy Botanalytics library
Copy the botanalytics.js
file from our official GitHub repository to the code/lib/
folder in your Samsung Bixby capsule.
Add Configurations & Secrets
On Samsung Bixby Developer Console, open the Configuration & Secrets page under your capsule settings and set required values.
Secrets
Name | Required | Default | Description |
---|---|---|---|
botanalytics.apiKey | Yes | Has no default | API key that is provided when a Samsung Bixby channel is added to a project. |
Configurations
Name | Required | Default | Description |
---|---|---|---|
botanalytics.baseUrl | No | https://api.beta.botanalytics.co/v2 | Base URL to be used for sending requests. Do not change this unless instructed by the Botanalytics team. |
botanalytics.failFast | No | no | Whether to fail when an exception is encountered when sending data to Botanalytics. To enable this feature, set this to true or yes . |
Log interactions with your capsule
Import Botanalytics library:
import { logInput, logOutput } from './lib/botanalytics.js';
Log input by passing action or intent name:
logInput('findCapital', input);
In JavaScript Runtime Version 2, functions instead receive a single parameter, an object with key/value pairs whose keys correspond to the input keys in the action. logOutput
method returns the provided output, so you can log and return the value in a single statement.
Log output by passing action or intent name, input and output to be returned.
return logOutput('findCapital', input, {
capital: capital,
stateGraphic: stateGraphic,
});