payload-posthog

Identify

Maps Payload auth logins to PostHog identify().

Identify is on by default and applies to every auth-enabled collection. Restrict it or customize the identified properties:

payloadPosthog({
  apiKey: process.env.POSTHOG_API_KEY!,
  identify: {
    collections: ['users'], // default: every auth-enabled collection
    properties: ({ user }) => ({ email: user.email, role: user.role }),
  },
})

Default properties are { email } (when present) plus { collection }. distinctId resolves the same way as capture — see distinctId resolution.