Configuration

Learn about the settings accepted by the module.

The module reads its configuration from your site’s settings.php (or settings.local.php), where each setting is a top-level key prefixed with croct.. Only the application ID and API key are required, and everything else has sensible defaults.

settings.php
$settings['croct.app_id'] = '<APPLICATION_ID>';$settings['croct.api_key'] = '<API_KEY>';

Drupal compiles settings.php into its cached container, so rebuild the cache with drush cr after changing any value.

Settings

The following list describes the available settings:

app_id
string

The ID of the application.

You can find it on the Integration page of your application.

api_key
string

The API key used to sign visitor tokens.

See API keys for more information.

debug(optional)
boolean

Whether to enable debug mode on the client-side SDK.

When enabled, the browser SDK logs detailed information to the console.

Default:false
script.url(optional)
string

The URL the client-side SDK loader is served from.

Defaults to the Croct CDN. Set it to a first-party path on your own domain to serve the loader from the same origin, or to a pinned version.

script.mode(optional)
string

The loading strategy for the script.

The following values are supported:

ValueDescription
deferLoads in the background and runs after the page is parsed.
asyncLoads in the background and runs as soon as it is ready.
syncLoads and runs immediately, blocking page rendering.
Default:defer
storyblok.enabled(optional)
boolean

Whether to personalize Storyblok content automatically.

Requires croct/plug-storyblok and a bound Storyblok Stories API.

Default:true