Skip to content

Commit e66f860

Browse files
fix: include userIdentifier in Session Replay Identify payload (#220)
## Summary - Mobile `Identify` Session Replay events rendered an empty description in the session player. The player resolves a description from `email || name || userIdentifier`, but the SDK only emitted `key` and `canonicalKey`. - Emit `userIdentifier` (friendly name when set, otherwise the canonical key) in the Identify payload so mobile identifies show a description, matching the web `Identify` payload shape (`{ userIdentifier, ...userObject }`) without any frontend changes. ## Notes - `email`/`name` are intentionally not plumbed: they aren't available at the identify hook call site (only `contextKeys` + `canonicalKey` are forwarded), and `userIdentifier` is sufficient to fix the empty-description bug. ## Test plan - [ ] Build the package - [ ] Trigger an identify and confirm the Session Replay Identify event renders a non-empty description in the session player Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 90c3fb3 commit e66f860

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sources/LaunchDarklySessionReplay/Exporter/IdentifyItemPayload.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ extension IdentifyItemPayload {
5151
if let contextFriendlyNameUnwrapped = options.contextFriendlyName, contextFriendlyNameUnwrapped.isNotEmpty {
5252
contextFriendlyName = contextFriendlyNameUnwrapped
5353
}
54-
attributes["key"] = contextFriendlyName ?? canonicalKey
54+
let displayKey = contextFriendlyName ?? canonicalKey
55+
attributes["key"] = displayKey
5556
attributes["canonicalKey"] = canonicalKey
57+
attributes["userIdentifier"] = displayKey
5658

5759
return attributes
5860
}

0 commit comments

Comments
 (0)