Skip to content

Move session ID hash into getAnonymousId - #26

Merged
jszobody merged 1 commit into
masterfrom
move-session-to-anonymous-id
Feb 20, 2026
Merged

Move session ID hash into getAnonymousId#26
jszobody merged 1 commit into
masterfrom
move-session-to-anonymous-id

Conversation

@jszobody

Copy link
Copy Markdown
Member

Summary

  • Moves the session ID hash from getUserId() into getAnonymousId()
  • Session-based users are anonymous (not authenticated), so this is the correct home for that logic
  • getUserId() now simply returns auth()->id() or getAnonymousId()
  • getAnonymousId() returns hashed session ID if available, otherwise a stable random string
  • Updates README to reflect the change

Session-based users are still anonymous (not authenticated), so the
hashed session ID belongs in getAnonymousId() alongside the random
string fallback. getUserId() now simply checks auth or anonymous.
@jszobody
jszobody merged commit d645675 into master Feb 20, 2026
1 check passed
@jszobody
jszobody deleted the move-session-to-anonymous-id branch February 20, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant