Skip to content

Conversation

pan93412
Copy link
Member

@pan93412 pan93412 commented Oct 6, 2025

  • feat: add PostHog client
  • feat: add PostHog analyze
  • feat(chat): instrument LLM usage
  • feat(chat): make system prompt cachable

@pan93412 pan93412 self-assigned this Oct 6, 2025
Copy link

linear bot commented Oct 6, 2025

Copy link
Contributor

vercel bot commented Oct 6, 2025

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

Project Deployment Preview Comments Updated (UTC)
dbplay-app Ready Ready Preview Comment Oct 6, 2025 1:14pm

@pan93412 pan93412 requested a review from Copilot October 6, 2025 13:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Integrates PostHog analytics platform for website statistics and user behavior tracking, including instrumentation of LLM chat usage and implementation of prompt caching optimization.

  • Added PostHog client configuration for both browser and server environments
  • Implemented user identification and session management for analytics tracking
  • Instrumented chat API to track LLM usage with user attribution and introduced prompt caching

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Added PostHog dependencies (@posthog/ai, posthog-js, posthog-node)
next.config.ts Configured PostHog proxy rewrites and trailing slash handling
instrumentation-client.ts Initialized PostHog client with API configuration
lib/posthog.rsc.ts Created server-side PostHog client factory
providers/posthog-identifier.tsx Component for user identification in PostHog
app/login/_components/posthog-resetter.tsx Component to reset PostHog session on login page
app/login/page.tsx Integrated PostHog session reset
app/(app)/layout.tsx Added PostHog identifier to authenticated app layout
lib/auth.rsc.ts Refactored auth function to return user info instead of boolean
app/api/chat/route.ts Added LLM usage tracking and prompt caching with GraphQL fragment refactoring
gql/ files Auto-generated GraphQL code updates from fragment changes
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pan93412 pan93412 merged commit 1f1afea into main Oct 6, 2025
4 checks passed
@pan93412 pan93412 deleted the pan93412/dbp-84-導入-posthog-進行網站統計 branch October 6, 2025 13:58
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