Configuration
Learn about the options accepted by the package.
The package is configured through config/croct.php. Only the application ID and API key are required, and everything else has sensible defaults.
Publish the file to customize any option:
php artisan vendor:publish --tag=croct-configOptions
The following list describes the available options:
- app_idstring
The ID of the application.
Defaults to the CROCT_APP_ID environment variable. You can find it on the Integration page of your application.
- api_keystring
The API key used to sign visitor tokens.
Defaults to the CROCT_API_KEY environment variable. Keep it out of source control by referencing it through the environment. 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.
When unset, it follows your application’s debug mode, so it is on in local development. When enabled, the browser SDK logs detailed information to the console.
- locale(optional)object
The settings for detecting the visitor locale.
See Locale detection for details.
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 package 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|null
The first-party path that serves the SDK from your own domain.
Set it to null 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 a bound Storyblok Stories API.
Default:true
- enabled(optional)