Skip to content

feat: capture all signups for Infisical Cloud#5752

Merged
carlosmonastyrski merged 3 commits intomainfrom
fix/ENG-4669
Mar 19, 2026
Merged

feat: capture all signups for Infisical Cloud#5752
carlosmonastyrski merged 3 commits intomainfrom
fix/ENG-4669

Conversation

@carlosmonastyrski
Copy link
Copy Markdown
Contributor

Context

This PR contains a small telemetry improvement to send the events of signup to Hubspot on Cloud instances

Screenshots

Steps to verify the change

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Updated CLAUDE.md files (if needed)
  • Read the contributing guide

@linear
Copy link
Copy Markdown

linear bot commented Mar 18, 2026

@maidul98
Copy link
Copy Markdown
Collaborator

maidul98 commented Mar 18, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR adds HubSpot CRM integration to capture signup events on Infisical Cloud, wiring two new signup flows (email account completion and invite-based account completion) into a new sendHubSpotSignupEvent telemetry call. The integration is correctly gated behind isProductionMode, InstanceType.Cloud, and both HubSpot env vars being present, consistent with the existing sendLoopsEvent pattern.

Key changes:

  • Two new optional env vars (HUBSPOT_PORTAL_ID, HUBSPOT_SIGNUP_FORM_ID) added to opt into the integration
  • New sendHubSpotSignupEvent function in the telemetry service that POSTs to the HubSpot Forms v3 API with email, signup method, and optional name fields built dynamically via a loop
  • authMethod is now surfaced from completeEmailAccountSignup's return value and forwarded to HubSpot; the invite flow uses the hardcoded literal "invite"
  • Minor: the HubSpot submission context always records pageUri as …/signup and pageName as "App Signup" regardless of which flow triggered the event, causing invite-based completions to be misattributed in HubSpot analytics

Confidence Score: 4/5

  • This PR is safe to merge; the integration is well-guarded and failures are non-blocking.
  • The implementation is solid: previous review concerns (missing isProductionMode guard and static field construction) have been addressed. The only outstanding issue is a minor analytics accuracy concern where the hardcoded pageUri/pageName in the HubSpot context misattributes invite-based account completions to the direct signup page in HubSpot reporting. This does not affect correctness or security of the signup flow itself.
  • backend/src/services/telemetry/telemetry-service.ts — the hardcoded HubSpot submission context (pageUri/pageName) affects analytics attribution accuracy for invite completions.

Important Files Changed

Filename Overview
backend/src/lib/config/env.ts Adds two optional env vars (HUBSPOT_PORTAL_ID, HUBSPOT_SIGNUP_FORM_ID) used to gate the new HubSpot integration. Both are optional strings with no validation beyond type — correct for opt-in telemetry keys.
backend/src/services/telemetry/telemetry-types.ts Introduces `HubSpotSignupMethod = AuthMethod
backend/src/services/auth/auth-signup-service.ts Extends the return value of completeEmailAccountSignup to include authMethod, defaulting to AuthMethod.EMAIL when not set. Minimal, correct change.
backend/src/server/routes/v3/signup-router.ts Wires sendHubSpotSignupEvent into both the email signup and invite completion flows. The email signup path passes the real authMethod enum value; the invite path passes the hardcoded literal "invite". Both paths share the same hardcoded /signup pageUri in the downstream service call.
backend/src/services/telemetry/telemetry-service.ts Adds sendHubSpotSignupEvent, properly guarded by isProductionMode, InstanceType.Cloud, and both HubSpot env vars. Dynamically builds optional fields via a loop. Error is caught and logged without disrupting the signup flow. Minor: pageUri and pageName in the HubSpot submission context are hardcoded to the direct-signup page, making invite-based completions misattributed in HubSpot analytics.

Last reviewed commit: "Merge remote-trackin..."

@carlosmonastyrski
Copy link
Copy Markdown
Contributor Author

@greptile please check the latest changes and re-check this PR, also update the Greptile Summary

@carlosmonastyrski carlosmonastyrski merged commit 2ec3285 into main Mar 19, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants