MCPcopy Index your code
hub / github.com/21st-dev/1code / identify

Function identify

src/renderer/lib/analytics.ts:118–136  ·  view source on GitHub ↗
(
  userId: string,
  traits?: Record<string, any>,
)

Source from the content-addressed store, hash-verified

116 * Identify a user
117 */
118export function identify(
119 userId: string,
120 traits?: Record<string, any>,
121) {
122 currentUserId = userId
123
124 // Skip in development mode
125 if (isDev) return
126
127 // Skip if user opted out
128 if (isOptedOut()) return
129
130 if (!initialized) return
131
132 posthog.identify(userId, {
133 ...getCommonProperties(),
134 ...traits,
135 })
136}
137
138/**
139 * Get current user ID

Callers 1

identifyUserFunction · 0.90

Calls 2

isOptedOutFunction · 0.85
getCommonPropertiesFunction · 0.70

Tested by

no test coverage detected