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

Function identify

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

Source from the content-addressed store, hash-verified

160 * Identify a user
161 */
162export function identify(
163 userId: string,
164 traits?: Record<string, any>,
165) {
166 currentUserId = userId
167
168 // Skip in development mode
169 if (isDev()) return
170
171 // Skip if user opted out
172 if (userOptedOut) return
173
174 if (!posthog) return
175
176 posthog.identify({
177 distinctId: userId,
178 properties: {
179 ...getCommonProperties(),
180 ...traits,
181 },
182 })
183}
184
185/**
186 * Get current user ID

Callers 2

index.tsFile · 0.90
trackAuthCompletedFunction · 0.70

Calls 2

isDevFunction · 0.70
getCommonPropertiesFunction · 0.70

Tested by

no test coverage detected