aws-rum-web icon indicating copy to clipboard operation
aws-rum-web copied to clipboard

[Feature Request]: Get sessionId

Open tsuga opened this issue 11 months ago • 3 comments

Please provide your feature request

It looks like that current web client does not provide a feature to get the sessionId without cookies enabled. This enables us to display the sessionId so that the end-user can pass it to our support team.

Sentry has this feature under getReplayId https://docs.sentry.io/platforms/javascript/session-replay/understanding-sessions/#connect-replays-with-support-software

NB. There is an workaround, If cookies are enabled, by getting the sessionId (and userId) from the cookie.

tsuga avatar Mar 29 '25 16:03 tsuga

Hi @tsuga , I'd really like to do this. Could you help me put together a more complete story to get this prioritized? Let me know

  1. Start new session
  2. Set session id
  3. Get session id
  4. Set user id
  5. Get user id

In addition are you interested in other metadata?

  1. Custom callback function to dynamically update custom metadata when the event is recorded

williazz avatar Apr 09 '25 06:04 williazz

@williazz From my end, I need to get the session id. The motivation is for the support capability as mentioned above.

Getting the user id is not relevant to me since I don't activate the cookies.

Setting user/session id and create/terminate a session are not of my interest either. Though others may have a use case.

I hope this helps.

tsuga avatar Apr 10 '25 14:04 tsuga

Hi @tsuga - to clarify, are you looking for the sessionId at runtime from within your application? Or within the RUM console?

Also, what web client version are you using? Starting from release 1.13.0, we should be generating unique sessionIds even if cookies are disabled.

limhjgrace avatar Jul 17 '25 23:07 limhjgrace