stack/packages/stack-shared/src
Madison 5e5cfdec4f
[Dashboard][Backend][SDK] - Adds sharable session replay ids. (#1294)
# Shareable Session Replay Links
Adds the ability to share individual session replays via unique, direct
URLs.

https://www.loom.com/share/1e3298a19b114fc38af4bc43dcd5ec48

## What changed
- New admin endpoint — GET /api/v1/internal/session-replays/:id
- Fetches a single session replay by ID with user metadata (display
name, primary email) and chunk/event counts
- Returns 404 if the replay doesn't exist
- Admin-only access, consistent with the existing list endpoint
## New standalone replay page —
/projects/:projectId/analytics/replays/:replayId
- Thin server page wrapper that passes the replay ID to the existing
PageClient
- PageClient detects standalone mode via initialReplayId prop and
fetches replay metadata directly instead of loading the full session
list
- Sidebar is hidden; the replay viewer takes the full width
- "Back to all replays" link shown under the page title
## Copy link button
- Moved from per-session sidebar items to the replay viewer header (next
to the settings gear)
- Copies a direct URL to the currently selected replay
## SDK plumbing
- AdminGetSessionReplayResponse type in stack-shared
- getSessionReplay() on StackAdminInterface, StackAdminApp interface,
and _StackAdminAppImplIncomplete
## Tests
- Happy path: fetch single replay by ID with inline snapshot
- 404 for nonexistent replay ID
- 401 for non-admin access (client and server)
## Test plan
- [ ] Open /analytics/replays, select a replay, click the link icon in
the header — verify URL is copied to clipboard
- [ ] Paste that URL in a new tab — verify the standalone replay page
loads and plays the correct replay
- [ ] Verify "Back to all replays" link navigates back to the list page
- [ ] Verify the original /analytics/replays list page still works as
before (selecting, filtering, pagination)
- [ ] Run pnpm test run session-replays


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Backend: internal endpoint to fetch a single session replay with user
info, millisecond timestamps, and chunk/event counts.
* Admin SDK/App: added response type and admin method to retrieve a
single session replay; admin app maps response into the app model.
* Dashboard: standalone session-replay page, UI adjustments for
standalone mode, and a “copy replay link” button.

* **Tests**
* Added end-to-end tests for retrieval, not-found, and access-control
scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-28 17:57:07 -05:00
..
ai Overview revamp (#1238) 2026-04-15 09:36:00 -07:00
apps Fraud Protection sub-app 2026-04-05 21:35:01 -07:00
config clickhouse new syncs and verify-data (#1304) 2026-04-08 14:43:22 -07:00
helpers fix(init-prompt): require StackProvider for all frameworks (#1374) 2026-04-24 12:27:49 -07:00
hooks Payments UX update (#863) 2025-08-27 17:28:01 -07:00
interface [Dashboard][Backend][SDK] - Adds sharable session replay ids. (#1294) 2026-04-28 17:57:07 -05:00
payments [Feat] Add payment methods page to dashboard (#1103) 2026-01-20 14:33:31 -08:00
utils fix(stack-shared): make process.env access browser-safe (#1391) 2026-04-28 10:59:49 -07:00
config-authoring.test.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
config-authoring.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
config-rendering.ts make config typesafe (#1254) 2026-04-06 18:31:55 +00:00
crud.tsx Config DB (#568) 2025-04-10 19:38:25 +02:00
global.d.ts Replace required() of yup schemas with defined() 2024-11-18 20:08:55 +01:00
index.ts [docs][dashboard][stack-shared] Update docs to new apps (#996) 2025-11-12 15:45:30 -06:00
known-errors.tsx Better error message when user info fetching fails 2026-04-13 11:10:32 -07:00
plans.ts [Fix] [Refactor] Implement Base Settings for Stack-Auth Plans and Move Metadata from Stripe Webhook Event to Table (#1214) 2026-02-23 22:09:27 -08:00
schema-fields.ts fix(stack-shared): make process.env access browser-safe (#1391) 2026-04-28 10:59:49 -07:00
sessions.ts Update AGENTS.md 2026-02-13 18:34:23 -08:00