diff --git a/src/posthog-core.ts b/src/posthog-core.ts index ab4e2809c..925a39c48 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -1537,7 +1537,7 @@ export class PostHog { this.surveys?.reset() this.persistence?.set_property(USER_STATE, 'anonymous') this.sessionManager?.resetSessionId() - const uuid = this.config.__use_cookieless_server_hash + const uuid = this.config.__preview_experimental_cookieless_mode ? COOKIELESS_SENTINEL_VALUE : this.config.get_device_id(uuidv7()) this.register_once( @@ -2057,7 +2057,7 @@ export class PostHog { } private _create_device_id(): string { - if (this.config.__use_cookieless_server_hash) { + if (this.config.__preview_experimental_cookieless_mode) { return COOKIELESS_SENTINEL_VALUE } return this.config.get_device_id(uuidv7()) diff --git a/src/sessionid.ts b/src/sessionid.ts index 83d906c58..4519fe4c3 100644 --- a/src/sessionid.ts +++ b/src/sessionid.ts @@ -230,7 +230,7 @@ export class SessionIdManager { const noSessionId = !sessionId const activityTimeout = !readOnly && Math.abs(timestamp - lastTimestamp) > this.sessionTimeoutMs if (noSessionId || activityTimeout || sessionPastMaximumLength) { - if (this.config.__use_cookieless_server_hash) { + if (this.config.__preview_experimental_cookieless_mode) { sessionId = COOKIELESS_SENTINEL_VALUE } else { sessionId = this._sessionIdGenerator() diff --git a/src/types.ts b/src/types.ts index 5b6e5040d..02d2d709b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -347,9 +347,9 @@ export interface PostHogConfig { /** * PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION - * whether to send a sentinel distinct id value, which will be replaced on the server by a hash + * whether to send a sentinel value for distinct id, device id, and session id, which will be replaced server-side by a cookieless hash * */ - __use_cookieless_server_hash?: boolean + __preview_experimental_cookieless_mode?: boolean } export interface OptInOutCapturingOptions {