After installing the stub it is then possible to use any of the OnSite API methods via the window.cact function.
The available methods are listed on the documentation under ONSITE API.
Each method follows a strict signature:
A string identifier used to select the desired method.
Below you will find an example method that is used to receive the TrustCommander consent with the OnSite API. This example only provides a callback to receive the consent without providing any options.
// Consent available for all categories.
The OnSite API methods are called asynchronously. In case e.g. you need information synchronous in the <head> of the document it is recommended to cache and retrieve the result of the API in localStorage.