Configuration

Learn about the options accepted by the bundle.

The bundle is configured through config/packages/croct.yaml. Only the application ID and API key are required, everything else has sensible defaults.

config/packages/croct.yaml
croct:    app_id: '%env(CROCT_APP_ID)%'    api_key: '%env(CROCT_API_KEY)%'

Options

The following list describes the available options:

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.

Reference it through an environment variable to keep it out of source control. See API keys for more information.

base_endpoint_url(optional)
string

The base URL for the API calls.

Override it only for testing, for example to point the SDK at a mock server.

Default:null
token_duration(optional)
integer

The lifetime of the issued visitor tokens, in seconds.

Default:86400
debug(optional)
boolean

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

Defaults to the %kernel.debug% parameter, so it is on in the development environment. When enabled, the browser SDK logs detailed information to the console.

Default:%kernel.debug%
locale(optional)
object

The settings for detecting the visitor locale.

See Locale detection for details.

enabled(optional)
boolean

Whether to detect the locale from the request.

Default:true
default(optional)
string

The locale used to serve content.

It overrides the detected locale, or sets a fixed locale when detection is disabled.

Default:null
identity(optional)
object

The settings for reconciling the visitor with your authenticated users.

See Identity for details.

enabled(optional)
boolean

Whether to sync the visitor with the authenticated Symfony Security user.

Default:true

The settings for the session cookies the SDK writes to the response.

domain(optional)
string

The domain for the cookies.

When unset, the cookies are scoped to the current host.

Default:null
secure(optional)
boolean

Whether to send the cookies only over HTTPS connections.

Default:true
same_site(optional)
string

The SameSite policy for the cookies.

The following values are supported:

ValueDescription
strictThe cookie is sent only to the same site.
laxThe cookie is sent to the same site and to cross-site requests that are safe.
noneThe cookie is sent to the same site and to cross-site requests.
Default:none
script(optional)
object

The settings for the client-side SDK loader, which the bundle injects into HTML responses.

auto_inject(optional)
boolean

Whether to inject the loader into HTML responses automatically.

Default:true
placement(optional)
string

The position where the loader is injected.

The following values are supported:

ValueDescription
headThe loader is injected into the document head.
bodyThe loader is injected at the end of the body.
Default:head
path(optional)
string|false

The first-party path that serves the SDK from your own domain.

Set it to false to load the SDK from the CDN instead.

Default:/_croct/plug.js
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(optional)
object

The settings for the Storyblok integration.

enabled(optional)
boolean

Whether to personalize Storyblok content automatically.

Requires croct/plug-storyblok and the Storyblok Symfony bundle to be installed.

Default:true