convex-posthog: PostHog Analytics Component for Convex
Hey everyone! 👋
I just published convex-posthog - a Convex component that makes it super easy to track user events with PostHog analytics directly from your mutations!
npm:
@samhoque/convex-posthog
GitHub: https://github.com/samhoque/convex-posthog
✨ What it does
Track user events server-side from your Convex mutations without blocking your app logic. Events are scheduled as background jobs, so analytics failures won't affect your core functionality.
🚀 Quick Example
🎁 Features
- 🔥 Non-blocking event tracking (uses ctx.scheduler.runAfter)
- 🛡️ Type-safe API with full TypeScript support
- ⚡ Zero-config when using environment variables
- 📦 Proper Convex component with all the best practices
📦 Installation
Then install the component in your Convex app:
Would love to hear feedback or ideas for improvements! This is my first Convex component, so let me know if you find it useful or have suggestions. 🙌GitHub
GitHub - SamHoque/convex-posthog: PostHog analytics component for C...
PostHog analytics component for Convex - track user events server-side - SamHoque/convex-posthog
4 Replies
this is great!! i'll add that to https://sticky.today
you got any users yet? are you tracking something? does it work well?
Ideas that Stick, literally
Organize thoughts, collaborate in real-time, and access your ideas from anywhere. Try it free today!
No users yet, but I am building a SaaS, and have been using it for a while, so I just extracted it into a component.
Feel free to leave feedback, I'll resolve them asap.
awesome, i was actually looking to setup posthog to my convex app, will def test it out
This looks really interesting, I was looking into using one dollar stats which is made by drizzle but wasn't having any look so decided I might use posthog. Think I will use this instead as seems a nice easy way to integrate posthog into convex.
@bryan_3mavericks did you end up testing it out?