Tracking recipes
Copy a hook into your app to track a common interaction with one line in each component.
import { track } from "@databuddy/sdk";
export function useFeatureTracking(feature: string) {
return (action: string, properties?: Record<string, unknown>) =>
track("feature_used", { feature, action, ...properties });
}Pick a recipe
Name events the same way everywhere
track() never throws and does nothing on the server, so it needs no try around it. In development, the provider's disabled prop stops every call.
Related
How is this guide?