Skip to content

Instrument Pendo Track Events#3

Open
novus-by-pendo[bot] wants to merge 1 commit into
mainfrom
novus/instrument-pendo-track-events
Open

Instrument Pendo Track Events#3
novus-by-pendo[bot] wants to merge 1 commit into
mainfrom
novus/instrument-pendo-track-events

Conversation

@novus-by-pendo

Copy link
Copy Markdown

Summary

Adds Pendo Track Event instrumentation across 17 events covering the full user lifecycle: project management, voice interviews, integrations, and onboarding.

Changes

New files

  • src/lib/pendo.ts — Server-side Pendo tracking utility. Sends HTTP POST requests to the Pendo Track API (data.pendo.io/data/track) with the integration key, visitor/account IDs, and event properties. Used by server-side route handlers and server actions.
  • src/env.d.ts — Added global pendo type declaration so client-side typeof pendo !== 'undefined' guards and pendo.track() calls type-check correctly.

Client-side events (14 events via pendo.track())

Event File Trigger
project_created Home.tsx After successful createProject call
project_updated Home.tsx After successful updateProject call
project_deleted Home.tsx After successful deleteProject call
interview_started Conversation.tsx onConnect callback from ElevenLabs
interview_completed Conversation.tsx onDisconnect with non-error reason
interview_failed Conversation.tsx onDisconnect with error, onError, or 15s connection timeout
research_brief_generated Conversation.tsx create_brief client tool completes
linear_issues_created Conversation.tsx create_issues client tool completes
interview_link_copied ProjectRow.tsx "Copy link" button click
session_reset ProjectRow.tsx "Retry" button after resetSession succeeds
linear_integration_disconnected IntegrationsContent.tsx After disconnectLinear completes
linear_team_selected LinearTeamSelector.tsx After selectLinearTeam succeeds
notion_database_created OnboardingSelectors.tsx After createNotionDatabase succeeds
onboarding_completed OnboardingSelectors.tsx Click on "Continue" link to /home

Server-side events (3 events via HTTP POST to Pendo Track API)

Event File Trigger
notion_integration_connected api/auth/notion/callback/route.ts After Notion OAuth token is stored
linear_integration_connected api/auth/linear/callback/route.ts After Linear OAuth token is stored
interview_usage_recorded actions.ts After call duration is recorded against usage cap

Supporting changes

  • src/app/onboarding/page.tsx — Replaced the static <Link> "Continue" button with a new <OnboardingContinueLink> client component that fires onboarding_completed on click, since the page itself is a server component.

Implementation notes

  • All client-side events are guarded with typeof pendo !== 'undefined' so the app works normally if the Pendo agent isn't loaded.
  • Server-side events use try/catch so tracking failures never break application flow.
  • No deduplication concerns: all events fire in direct response to user actions or one-shot callbacks, not in polling loops or re-rendering effects.

Client-side events (pendo.track):
- project_created, project_updated, project_deleted (Home.tsx)
- interview_started, interview_completed, interview_failed (Conversation.tsx)
- research_brief_generated, linear_issues_created (Conversation.tsx)
- interview_link_copied, session_reset (ProjectRow.tsx)
- linear_integration_disconnected (IntegrationsContent.tsx)
- linear_team_selected (LinearTeamSelector.tsx)
- notion_database_created, onboarding_completed (OnboardingSelectors.tsx)

Server-side events (HTTP POST to Pendo Track API):
- notion_integration_connected (Notion OAuth callback)
- linear_integration_connected (Linear OAuth callback)
- interview_usage_recorded (actions.ts recordUsage)

Supporting changes:
- Add pendo global type declaration (env.d.ts)
- Add server-side Pendo tracking utility (lib/pendo.ts)
- Extract OnboardingContinueLink client component for onboarding_completed event
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
voicescope Ready Ready Preview, Comment Jun 19, 2026 5:29am

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.

1 participant