Members
(protected, inner) config :module:config~DefaultConfig
SDK configurations object
Type:
(protected, inner, constant) defaultConfig :module:config~DefaultConfig
Default SDK configuration options
Type:
Methods
(inner) get(key) → {string}
Get a single property from the configuration.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Config key |
Returns:
key Config key
- Type
- string
(inner) getAll() → {module:config~DefaultConfig}
Returns the current keys and values of the config.
Returns:
Returns a clone of the config object.
NOTE: Uses a clone so that the user cannot directly access the config object.
(inner) init(initialConfig) → {module:config~DefaultConfig}
Set all properties of the configuration.
Can only be called once; however, configuration can be reset using module:config~reset,
then this method can be called again. (Although, this is not recommended.)
NOTE: This is a much safer configuration approach than the set method, as it eliminates
some potential edges case issues for PII-enabled programs.
Parameters:
| Name | Type | Description |
|---|---|---|
initialConfig |
module:config~DefaultConfig | Configuration values that will override default values. |
Returns:
Frozen config object.
(inner) reset()
Reset the configuration to defaults and allow module:config~init
to be called again.
(inner) set(key, value) → {*}
Set a property of the configuration
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Key of a configuration property |
value |
* | Value of a configuration property |
Returns:
The value given.
- Type
- *
Type Definitions
DefaultConfig
Default SDK configuration options type
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
clientId |
string | RewardOps API OAuth |
||
clientSecret |
string | RewardOps API OAuth |
||
apiServerUrl |
string |
<optional> |
API server URL that the SDK will use for requests.
If unset, the SDK uses |
|
apiVersion |
string |
<optional> |
'v4' | Version of the RewardOps API to use for requests. This affects the SDK methods available and the API baseUrl. |
piiServerUrl |
string |
<optional> |
Geographic-specific PII storage server URL that the SDK will use for requests. |
|
supportedLocales |
Array |
<optional> |
List of accepted locales for the program, in the format of Accept-Language
as per RFC2616; e.g. |
|
timeout |
number |
<optional> |
20000 | Timeout for HTTP requests (used by Request library). |
logFilePath |
string |
<optional> |
'<parent dir>/logs/ro.log' | Path for log output file. |
logToFile |
boolean |
<optional> |
false | If |
silent |
boolean |
<optional> |
false | Suppress console logging. |
verbose |
boolean |
<optional> |
false | Run SDK with verbose logging. NOTE: Superseded by |
quiet |
boolean |
<optional> |
false | Run SDK with minimal logging. NOTE: Superseded by |