Skip to content

Commit

Permalink
Comments and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Dec 10, 2024
1 parent d6bae73 commit 13545a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/sessionid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 13545a0

Please sign in to comment.