Skip to content

Commit 5512485

Browse files
committed
chore: fix posthog emails
1 parent 92c1e77 commit 5512485

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/cli/src/cli/utils/observability.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pkg from "node-machine-id";
22
const { machineIdSync } = pkg;
33
import https from "https";
4-
import crypto from "crypto";
54
import { getOrgId } from "./org-id";
65

76
const POSTHOG_API_KEY = "phc_eR0iSoQufBxNY36k0f0T15UvHJdTfHlh8rJcxsfhfXk";
@@ -18,9 +17,8 @@ function determineDistinctId(email: string | null | undefined): {
1817
const orgId = getOrgId();
1918

2019
if (email) {
21-
const hashedEmail = crypto.createHash("sha256").update(email).digest("hex");
2220
return {
23-
distinct_id: hashedEmail,
21+
distinct_id: email,
2422
distinct_id_source: "email",
2523
org_id: orgId,
2624
};
@@ -72,6 +70,7 @@ export default function trackEvent(
7270
distinct_id: identityInfo.distinct_id,
7371
properties: {
7472
...properties,
73+
...(email ? { $set: { email } } : {}),
7574
$lib: "lingo.dev-cli",
7675
$lib_version: process.env.npm_package_version || "unknown",
7776
tracking_version: TRACKING_VERSION,

0 commit comments

Comments
 (0)