Files
zeekay e43ab1afe7 chore: rename all PostHog references to Insights/Hanzo
Bulk rename across 989 files:
- Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc.
- Repository URLs: posthog/posthog-js → hanzoai/insights-js
- Brand names: PostHog → Insights
- File renames: 259 reference JSON files, source files, workflow files
- Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights

Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
2026-03-06 01:41:12 -08:00

81 lines
2.0 KiB
TypeScript

import { useInsights } from '@hanzo/insights/react'
const events = [
{
name: 'Product Added',
properties: {
product_id: 'SomeProductID',
name: 'SomeProductName',
price: 42,
quantity: 1,
},
},
{
name: 'Products Searched',
properties: {
products: [
{
product_id: 'SomeProductID',
name: 'SomeProductName',
price: 42,
},
{
product_id: 'OtherProductID',
name: 'OtherProductName',
price: 43,
},
],
},
},
{
name: 'Product Added to Wishlist',
properties: {
product_id: 'SomeProductID',
name: 'SomeProductName',
price: 42,
quantity: 1,
wishlist_id: 'SomeWishlistID',
wishlist_name: 'SomeWishlistName',
},
},
{
name: 'Order Completed',
properties: {
products: [
{
product_id: 'SomeProductID',
name: 'SomeProductName',
price: 42,
},
{
product_id: 'OtherProductID',
name: 'OtherProductName',
price: 43,
},
],
total: 83,
currency: 'USD',
},
},
{
name: 'Custom Event',
properties: {
foo: 'bar',
},
},
]
export default function Ecommerce() {
const insights = useInsights()
return (
<div className="flex items-center gap-2 flex-wrap">
{events.map((event) => (
<button key={event.name} onClick={() => insights.capture(event.name, event.properties)}>
{event.name}
</button>
))}
</div>
)
}