Configuration with Javascript

The HTML snippet provided for installation includes only basic configuration, like your API key. There are a handful of other options you can use to configure the Sovrn Commerce JavaScript library.

Most users will not need to use these options.

Options

key
Your Commerce API key, found on your account page. required; string

api_url
The base URL for API calls. If you’re using your own CNAME for api.viglink.com, be sure to set this option to
"///api".
optional; string; default:
"//api.viglink.com/api"

cuid
If set, this value is included as the CUID when the library makes API calls on this page.
optional; string

enabled
Enable the library. When set to false, library initialization will be aborted immediately and no API calls will occur. When disabled, JavaScript API methods will work in a failsafe mode, so the user experience is not affected.
optional; boolean; default: true

reaffiliate
By default, Commerce will not modify links which are already affiliated. To force re-affiliation for a single page, set reaffiliate to true. If you’d like to force re-affiliation globally, you can make that change in your Commerce settings.
optional; boolean; default: false

Example

var vglnk = {
key:  "88ac2a40e081e283ac504d1789d398ac",
cuid: "abc123"
}