Scandit.Config

Simple key/value environment variables set via the Web Dashboard on a per activity basis, that are exposed to the activity.

Methods

(static) get(key: string): string

Get a key's value, where key was set as an environment variable for the activity on the Web Dashboard.

Parameters:
Name Type Description
key string

Environment variable name, set as the key for the environment variable

Returns:
string

Value of the key or null if the key does not exist in the environment variables

Examples
  • JavaScript
  • ES6
var key = 'target_url';
var value = Scandit.Config.get(key);
console.log('The value of ' + key + ' is ' + value);
const key = 'target_url';
const value = Scandit.Config.get(key);
console.log(`The value of ${key} is ${value}`);

(static) getColors(): Scandit.Config.Colors

Get the colors defined in the Appearance section of the Web Dashboard.

Returns:
Scandit.Config.Colors

The colors set on the Web Dashboard

Examples
  • JavaScript
  • ES6
var colors = Scandit.Config.getColors();
var colors = Scandit.Config.getColors();

Get the URI of the logo defined in the Appearance section of the Web Dashboard.

Returns:
string

The URI of the logo set on the Web Dashboard

Examples
  • JavaScript
  • ES6
var logoUri = Scandit.Config.getLogo();
var logoUri = Scandit.Config.getLogo();

Type Definitions

Colors

Properties:
Name Type Description
logoBar string

logo bar color

navigationBar string

navigation bar color

navigationBarText string

navigation bar text color

activityTitle string

activity title color

activityDescription string

activity description color

background string

background color

primaryAction string

primary action color

primaryActionText string

primary action text color

secondaryAction string

secondary action color

secondaryActionText string

secondary action text color