Configuration
- Copyright:
- 2015–2020 RewardOps Inc.
Members
module:config~DefaultConfig
# protected inner constant defaultConfig
Default SDK configuration options
Methods
# inner get(key) → {string}
Get a single property from the configuration.
Parameters:
Name | Type | Description |
---|---|---|
key |
string
|
Config key |
key Config key
string
# inner getAll() → {module:config~DefaultConfig}
Returns the current keys and values of the config
.
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. |
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 |
- Deprecated:
- since version 1.3.0
The value given.
*
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 |