File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,34 @@ export const RybbitAnalyticsOptions = object({
14
14
export type RybbitAnalyticsInput = RegistryScriptInput < typeof RybbitAnalyticsOptions , false >
15
15
16
16
export interface RybbitAnalyticsApi {
17
+ /**
18
+ * Tracks a page view
19
+ */
17
20
pageview : ( ) => void
18
- event : ( eventName : string , properties ?: Record < string , any > ) => void
21
+
22
+ /**
23
+ * Tracks a custom event
24
+ * @param name Name of the event
25
+ * @param properties Optional properties for the event
26
+ */
27
+ event : ( name : string , properties ?: Record < string , any > ) => void
28
+
29
+ /**
30
+ * Sets a custom user ID for tracking logged-in users
31
+ * @param userId The user ID to set (will be stored in localStorage)
32
+ */
33
+ identify : ( userId : string ) => void
34
+
35
+ /**
36
+ * Clears the stored user ID
37
+ */
38
+ clearUserId : ( ) => void
39
+
40
+ /**
41
+ * Gets the currently set user ID
42
+ * @returns The current user ID or null if not set
43
+ */
44
+ getUserId : ( ) => string | null
19
45
}
20
46
21
47
declare global {
You can’t perform that action at this time.
0 commit comments