stack/apps/backend/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
..
app [Dashboard][Backend][SDK] - Adds sharable session replay ids. (#1294) 2026-04-28 17:57:07 -05:00
auto-migrations Migration tests 2026-02-17 15:58:06 -08:00
lib Dashboard: DataGrid refactor + layout (stacked on overview-revamp) (#1338) 2026-04-27 13:50:24 -07:00
oauth fix: refresh-token P2025 race with concurrent sign-out (#1372) 2026-04-24 18:44:39 +00:00
private Update submodules 2026-04-20 19:01:16 -07:00
route-handlers Don't override 5xx errors 2026-04-18 19:31:13 -07:00
utils Backend fallback (cloud run) (#1306) 2026-04-11 00:57:37 +00:00
analytics.tsx Fix event capture 2024-08-14 12:49:35 -07:00
globals.d.ts Split backend and dashboard (#83) 2024-06-18 15:49:31 +02:00
instrumentation.ts Onboarding app & restricted users (#1069) 2026-01-11 17:22:14 -08:00
polyfills.tsx waitUntil Sentry flush is complete 2026-04-18 22:28:02 -07:00
prisma-client.tsx Fix bigint serialization error on tracing 2026-04-18 14:46:03 -07:00
proxy.tsx External db sync (#1036) 2026-02-05 12:04:31 -08:00
s3.tsx session replays (#1187) 2026-02-16 14:15:17 -08:00
smart-router.tsx Move /api/v1 to /api/latest 2025-02-05 17:24:43 -08:00
stack.tsx Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00