Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

posthog attribution adjustment

Vladyslav Matsiiakoa6f6711c9adf
diff --git a/backend/src/controllers/v2/secretsController.ts b/backend/src/controllers/v2/secretsController.ts
index 5c5140587a..aa738972d0 100644
--- a/backend/src/controllers/v2/secretsController.ts
+++ b/backend/src/controllers/v2/secretsController.ts
@@ -144,7 +144,8 @@ export const batchSecrets = async (req: Request, res: Response) => {
workspaceId,
channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: req.user.email
}
});
}
@@ -232,7 +233,8 @@ export const batchSecrets = async (req: Request, res: Response) => {
workspaceId,
channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: req.user.email
}
});
}
@@ -268,7 +270,8 @@ export const batchSecrets = async (req: Request, res: Response) => {
workspaceId,
channel: channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: req.user.email
}
});
}
@@ -545,7 +548,10 @@ export const createSecrets = async (req: Request, res: Response) => {
workspaceId,
channel: channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: await TelemetryService.getDistinctId({
+ authData: req.authData
+ })
}
});
}
@@ -748,7 +754,10 @@ export const getSecrets = async (req: Request, res: Response) => {
workspaceId,
channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: await TelemetryService.getDistinctId({
+ authData: req.authData
+ })
}
});
}
@@ -978,7 +987,10 @@ export const updateSecrets = async (req: Request, res: Response) => {
workspaceId: key,
channel: channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: await TelemetryService.getDistinctId({
+ authData: req.authData
+ })
}
});
}
@@ -1119,7 +1131,10 @@ export const deleteSecrets = async (req: Request, res: Response) => {
workspaceId: key,
channel: channel,
userAgent: req.headers?.['user-agent'],
- isPaid
+ isPaid,
+ email: await TelemetryService.getDistinctId({
+ authData: req.authData
+ })
}
});
}
diff --git a/frontend/src/components/utilities/attemptLogin.ts b/frontend/src/components/utilities/attemptLogin.ts
index e92a65e777..fdcf8ad160 100644
--- a/frontend/src/components/utilities/attemptLogin.ts
+++ b/frontend/src/components/utilities/attemptLogin.ts
@@ -120,7 +120,7 @@ const attemptLogin = async (
}
if (email) {
- telemetry.identify(email);
+ telemetry.identify(email, email);
telemetry.capture('User Logged In');
}
diff --git a/frontend/src/components/utilities/telemetry/Telemetry.ts b/frontend/src/components/utilities/telemetry/Telemetry.ts
index b31007f1c4..2676bed852 100644
--- a/frontend/src/components/utilities/telemetry/Telemetry.ts
+++ b/frontend/src/components/utilities/telemetry/Telemetry.ts
@@ -22,10 +22,12 @@ class Capturer {
}
}
- identify(id: string) {
+ identify(id: string, email?: string) {
if (ENV === 'production' && TELEMETRY_CAPTURING_ENABLED) {
try {
- this.api.identify(id);
+ this.api.identify(id, {
+ email: email
+ });
} catch (error) {
console.error('PostHog', error);
}