Skip to content

Conversation

@Scott-Sowers-PostHog
Copy link
Collaborator

Summary

Fixes the evaluate-flags API route to properly use the logEmitter singleton and correct PostHog SDK method.

Changes

  • ✅ Fixed import from non-existent getLogEmitter to logEmitter singleton
  • ✅ Converted all log emit calls to use typed methods (info, success, error)
  • ✅ Replaced generic emit with task/message/data structure with cleaner method calls
  • ✅ Fixed PostHog client shutdown call from shutdownAsync() to shutdown()

Technical Details

Before

import { getLogEmitter } from "@/lib/log-emitter";
const logEmitter = getLogEmitter();
logEmitter.emit("log", { task: "flag-evaluation", message: "...", data: {...} });
await posthogClient.shutdownAsync();

After

import { logEmitter } from "@/lib/log-emitter";
logEmitter.info(`Evaluating flags for ${distinctId}...`);
await posthogClient.shutdown();

Benefits

  • Aligns with the standardized logging pattern used in server actions
  • Fixes runtime error from incorrect import
  • Uses correct PostHog Node.js SDK method
  • Cleaner, more readable log messages

🤖 Generated with Claude Code

Scott-Sowers-PostHog and others added 3 commits November 6, 2025 12:24
Updated import from non-existent getLogEmitter to logEmitter singleton and converted all log emit calls to use typed methods (info, success, error) instead of generic emit with task/message/data structure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed shutdownAsync() to shutdown() to use the correct PostHog Node.js SDK method.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add API endpoint to fetch all feature flags from PostHog
- Implement dropdown selector to switch between different flags
- Update all components to respond to selected flag changes
- Add person properties management with key-value pairs
- Add reset distinct ID functionality
- Add timing metrics to flag evaluation
- Improve terminal styling with macOS-inspired design
- Add spacing improvements to form layout

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants