Skip to content

Commit a843165

Browse files
committed
Add documentation for supplying a test configuration to the 'getConfig' method.
1 parent c17a14d commit a843165

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

source/includes/_utilities.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ In addition to the event based system for working with sites, some utility metho
3030

3131
This can be used to obtain an array of attributes for the currently displayed vehicles on a page. For example, passing the attribute 'finalPrice' would return an array of all of the final prices on the page. Passing 'vin' would return an array of vehicle vins. You can pass any of the attributes that are present on the <a href="#vehicle-event">Vehicle Event object</a> and have this return an array.
3232

33-
## API.utils.getConfig()
33+
## API.utils.getConfig(testConfig)
3434

3535
> Usage:
3636
3737
```javascript
3838
(function(WIAPI) {
3939
var API = new WIAPI('test-integration');
40-
API.utils.getConfig().then(function(config) {
40+
var testConfig = {
41+
dealerId: "12345",
42+
showOnSRP: true,
43+
showOnVDP: false,
44+
apiKey: "abcd12349876zyxw"
45+
}
46+
API.utils.getConfig(testConfig).then(function(config) {
4147
// Output the configuration object for your integration (if defined).
4248
API.log(config);
4349
});
@@ -46,6 +52,8 @@ This can be used to obtain an array of attributes for the currently displayed ve
4652

4753
This fetches a JavaScript object of your integration's configuration for the current website and page. Not all integrations have configuration options in our system (aside from enabled/disabled), but if your integration does, you can use this to obtain the configuration data.
4854

55+
`testConfig` is an optional parameter you can send into the `getConfig` method. The format should be a JavaScript object. Using the `testConfig`, you can specify any key/value pairs you need for configuration data for your integration to test various scenarios. The `testConfig` is only applied when `?_integrationMode=debug` is in the URL of the site you are testing, and that site does not already have your integration configured. If the site does have your integration configured, you can override the config specified on our side by also including `&_integrationConfig=override` in the URL.
56+
4957
## API.utils.getDealerData()
5058

5159
> Usage:

0 commit comments

Comments
 (0)