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.
croct: app_id: '%env(CROCT_APP_ID)%' api_key: '%env(CROCT_API_KEY)%'Options
The following list describes the available options:
- app_idstring
The ID of the application.
You can find it on the Integration page of your application.
- api_keystring
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.
- 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
- enabled(optional)
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:
Value Description strict The cookie is sent only to the same site. lax The cookie is sent to the same site and to cross-site requests that are safe. none The cookie is sent to the same site and to cross-site requests. Default:none
- domain(optional)
- 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:
Value Description head The loader is injected into the document head. body The 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:
Value Description defer Loads in the background and runs after the page is parsed. async Loads in the background and runs as soon as it is ready. sync Loads and runs immediately, blocking page rendering. Default:defer
- auto_inject(optional)
- 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
- enabled(optional)