OptionalisAuthenticated: booleanOptionalonSuccess: (result: { pseudonym: string; userId: string }) => voidOptionalonError: (error: string) => voidObject containing socket, pseudonym, userId, connection state, and lastReconnectTime (non-null whenever the socket reconnected after a gap long enough that messages may have been missed — callers should re-fetch message history when this value changes)
Custom hook to handle socket initialization. _app.tsx guarantees SessionManager has completed initialization before pages render.
Handles: