---
title: "Settings object"
slug: "settings-object"
abstract: "Describes the settings object in the Sitecore Engage SDK (Sitecore CDP Stream API)."
---
# Settings object

Use the settings object to initialize the Engage SDK. In the settings object, you include details about your Sitecore CDP instance.

The Engage SDK supports setting cookies from the client and from the server.

- To set cookies from the client, you must set the `forceServerCookieMode` attribute to `false` and pass the settings object to the [`Engage.init()`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/engage-init.html "Engage.init(settings)") function.
- To set cookies from the server, you must set the `forceServerCookieMode` attribute to `true` and pass the settings object to the [`Engage.init()`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/engage-init.html "Engage.init(settings)") function on the client side, and to the [`Engage.initServer()`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/engage-initserver.html "Engage.initServer(settings)") function on the server side.

The settings object includes the following attributes:

| Attribute | Type | Description | Example | Required/optional |
| --- | --- | --- | --- | --- |
| `clientKey` | string | Your [client key](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/collect-required-details.html). | `"ZpHxO9WvLOfQRVPlvo0BqB8YjGYuFfNe"` | Required |
| `targetURL` | string | Your [Stream API target endpoint](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/collect-required-details.html).<br><br>The value depends on the location of your Sitecore CDP server. | Must be one of:<br><br><ul><li>`"https://api-engage-ap.sitecorecloud.io​"`</li><li>`"https://api-engage-eu.sitecorecloud.io"`</li><li>`"https://api-engage-jpe.sitecorecloud.io"`</li><li>`"https://api-engage-us.sitecorecloud.io"`</li></ul> | Required |
| `includeUTMParameters` | boolean | Specify whether to add every [UTM parameter](https://en.wikipedia.org/wiki/UTM_parameters) from the URL of the current webpage to the event object.<br><br>The default is `true`.<br><br>If `true`, UTM parameters are added to [the VIEW event object](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/view-event.html). | `true` or `false` | Optional |
| `cookieDomain` | string | Your [cookie domain](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/collect-required-details.html).<br><br>The default is what the browser sets. | <ul><li>`".myretailsite.com"`</li><li>`".beta.myretailsite.com"`</li><li>`"localhost"`</li></ul> | Optional |
| `cookieExpiryDays` | integer | The number of days before the cookie expires.<br><br>If you don't specify this value, the cookie expires according to the `Max-Age` that the browser sets. | For example, set the value to `1` for the cookie to expire in 1 day. | Optional |
| `cookiePath` | string | A URL path that must exist in the requested URL in order to send the cookie. | `N/A` | Optional |
| `forceServerCookieMode` | boolean | Specify whether to set cookies from the client or from the server.<br><br>If you can access the server side of your app, you can choose to set cookies from the server instead of the client.<br><br>To set cookies from the server, set the value to `true` on both the server and the client side.<br><br>The default is `false`. | `true` or `false` | Optional |
| `webPersonalization` | boolean or object | On the client side, specify whether you want to run personalization with Sitecore Personalize. This attribute is not available on the server side.<br><br>If you don't specify this attribute on the client side, or if you specify it and set the value to `false`, personalization will not be available.<br><br>If you set the value to `true` or to an object, you must also specify the [`pointOfSale`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/settings-object.html#UUID-60c6365e-ff13-69eb-f0eb-aab96f66de3e_para-idm1903351367736576).<br><br>If you set the value to `true`, a web personalization script will load in your app with `async` but without `defer`.<br><br>You can customize the loading of the script by setting the value to an object. In the object:<br><br><ul><li>Customize `async` and `defer` using `asyncScriptLoading` and `deferScriptLoading`, respectively. For these attributes, set boolean values.</li><li>Use the `baseURLOverride` attribute to load the web personalization script from a custom URL.<br>If your [Stream API target endpoint](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/collect-required-details.html) is in **JP Region**, set `baseURLOverride` to:<br>`"https://d2ez8k04aaol9g.cloudfront.net"`<br>Alternatively, if you received a custom URL from Sitecore to load the web personalization script, set `baseURLOverride` to that URL.</li></ul><br><br>The default is `false`. | <ul><li>Enable web personalization:<br>`true`</li><li>Load the script without `async`:<br>`{ asyncScriptLoading: false }`</li><li>Load the script without `async` but with `defer`:<br>`{ asyncScriptLoading: false, deferScriptLoading: true }`</li><li>If your Stream API target endpoint is in **JP Region**:<br>`{ baseURLOverride: "https://d2ez8k04aaol9g.cloudfront.net" }`</li><li>Load the script using a custom URL:<br>`{ baseURLOverride: "https://..." }`</li></ul> | Optional on the client side.<br><br>Not available on the server side. |
| `pointOfSale` | string | [The name of the point of sale](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538) where the interaction with your brand takes place.<br><br>If you specified the `webPersonalization` attribute on the client side and set the value to `true` or to an object, you must specify `pointOfSale`.<br><br>You must set this value to the name of a point of sale that exists in your instance of Sitecore CDP.<br><br>If you don't specify `pointOfSale` in the settings object, you must specify it in every [event data object](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object.html). | `"myretailsite/ireland"` | Required if you specified the `webPersonalization` attribute. Optional otherwise. |

Initialize the Engage SDK, setting cookies from the client and using web personalization:

```javascript
import { init } from "@sitecore/engage";

const engageSettings = {
  clientKey: "<client_key_PLACEHOLDER>",
  targetURL: "<stream_api_target_endpoint_PLACEHOLDER>",
  pointOfSale: "<point_of_sale_PLACEHOLDER>",
  cookieDomain: "<cookie_domain_PLACEHOLDER>",
  cookieExpiryDays: 365,
  forceServerCookieMode: false,
  webPersonalization: false /* boolean or object. Default: false */
};

const loadEngage = async () => {
  // Load Engage API
  const engage = await init(engageSettings);
};

```