Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

tracekit-session-replayTracekit 会话重放

Agent Skill

tracekit-session-replay 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

1

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tracekit-session-replay(Tracekit 会话重放)
来源仓库:https://github.com/tracekit-dev/tracekit-for-ai
仓库路径:skills/tracekit-session-replay
安装命令:
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-session-replay
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-session-replay

简介

用于查找、检索和筛选相关信息。

  • 适合在需要快速定位关键词或任务场景时使用。
  • 可结合来源仓库和原始 README 继续核验具体用法。
  • 安装命令:npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-session-replay
  • 建议确认权限范围和是否执行命令后再使用

SKILL.md

TraceKit Session Replay

Auth Bootstrap

Do not tell the user to go sign up, log in separately, or manually create an API key before setup. First check for existing TraceKit auth. If ~/.tracekitconfig does not contain the production profile or TRACEKIT_API_KEY is missing, apply the tracekit-auth skill first. Use ./scripts/run-tracekit-auth.sh status to check, then guide the user through the TraceKit email verification flow with register and verify. That flow signs the user into an existing account for that email or creates the account automatically, then saves the returned credentials for the rest of the setup.

When To Use

Use this skill when the user asks to:

  • Record user sessions for debugging
  • Replay what a user did before an error
  • Set up visual debugging or session recording
  • See what users did on the page
  • Debug user-reported issues visually
  • Add session replay to a frontend app

Session replay is a browser-only feature. It records DOM mutations, user interactions, and network requests to reconstruct a video-like replay of user sessions. Replays are linked to distributed traces so you can see the full backend context for any user action.

Non-Negotiable Rules

  1. Never hardcode API keys in code. Always use environment variables or build-time injection.
  2. Text masking and input masking are always on and not configurable. The SDK masks all text with same-length asterisk replacement and masks all input values by default. There is no option to disable this. You can only selectively unmask elements using unmask selectors or the data-tracekit-unmask attribute.
  3. Always include a verification step confirming replays appear in https://app.tracekit.dev/replays.
  4. Always discuss GDPR/privacy implications before enabling replay - session recordings capture user behavior and may be subject to data protection regulations.

Prerequisites

Session replay requires a frontend SDK to be installed and initialized. Complete one of the following SDK skills first:

  • tracekit-browser-sdk - Vanilla JavaScript/TypeScript
  • tracekit-react-sdk - React applications
  • tracekit-vue-sdk - Vue applications
  • tracekit-angular-sdk - Angular applications
  • tracekit-nextjs-sdk - Next.js applications
  • tracekit-nuxt-sdk - Nuxt applications

Session replay is a BROWSER-ONLY feature. It does not apply to backend SDKs (Node.js, Go, Python, etc.). If the user is working on a backend project, this skill does not apply.

Detection

Before applying this skill, verify a frontend TraceKit SDK is installed:

  1. Check package.json for any TraceKit frontend package:

- @tracekit/browser - vanilla JS/TS - @tracekit/react - React - @tracekit/vue - Vue - @tracekit/angular - Angular - @tracekit/nextjs - Next.js - @tracekit/nuxt - Nuxt

  1. If none found, redirect to tracekit-browser-sdk skill (or the appropriate framework skill) to install the SDK first.
  2. Check if replay is already configured - search for @tracekit/replay in package.json or replayIntegration in source files.

Step 1: Install Replay Integration

npm install @tracekit/replay

The replay integration is a separate package that adds session recording capabilities to your existing TraceKit browser SDK.

Step 2: Add Replay to SDK Init

Add the replay integration to your TraceKit initialization:

import { init } from '@tracekit/browser';
import { replayIntegration } from '@tracekit/replay';

const replay = replayIntegration({
  // Sampling
  sessionSampleRate: 0.1,   // Record 10% of all sessions (default)
  errorSampleRate: 0.0,     // Capture rate for error-only buffer sessions (default)

  // Privacy - blockMedia defaults to true, text/input masking is always on
  blockMedia: true,          // Block images, videos, canvas, svg, iframe (default)
  inlineImages: false,       // Do not inline images as base64 (default)
  unmask: [],                // CSS selectors for elements safe to show unmasked
});

init({
  apiKey: import.meta.env.VITE_TRACEKIT_API_KEY,
  serviceName: 'my-frontend-app',
  endpoint: 'https://app.tracekit.dev',
  addons: [replay],
});

Step 3: Privacy Configuration

This is the most critical section. Session replay records user interactions, so privacy must be understood before deploying to production.

Text and Input Masking (Always On)

Text masking and input masking are always enabled and not configurable. The SDK:

  • Masks all text content with same-length asterisk replacement (e.g., "Hello" becomes "*****")
  • Masks all form input values (passwords, emails, search queries)
  • Uses maskTextSelector: '*' and maskAllInputs: true internally - these cannot be turned off

To selectively show specific text content, use unmasking:

SettingDefaultDescription
unmask: ['.public-content'][]CSS selectors for elements safe to show unmasked. Use sparingly.
data-tracekit-unmask attributen/aAdd this HTML attribute to any element that should display unmasked text.

Example: Unmasking specific public content:

<!-- These elements will show their real text in replays -->
<h1 data-tracekit-unmask>Welcome to Our App</h1>
<nav class="public-nav" data-tracekit-unmask>
  <a href="/pricing">Pricing</a>
  <a href="/docs">Docs</a>
</nav>

<!-- Everything else is masked automatically -->
<p>This text appears as asterisks in replay</p>
const replay = replayIntegration({
  unmask: ['.public-nav', '.marketing-hero'],  // CSS selectors to unmask
});

Media Blocking

SettingDefaultDescription
blockMedia: truetrueBlocks images, videos, canvas, SVG, and iframe elements from recording. Replaced with placeholders. Strongly recommended.
inlineImages: falsefalseWhen true, captures images as base64 data URIs. Increases payload size significantly. Only enable if you need to see images in replays.

GDPR Considerations

Session replay records user behavior and may be subject to GDPR, CCPA, or other data protection regulations:

  1. Consent required - Display a consent banner before enabling session replay. Only start recording after the user consents.
  2. Data retention - Configure retention in the dashboard (Settings > Data Retention). Default is 30 days.
  3. Right to deletion - Users can request deletion of their session data. Use the TraceKit API to delete sessions by user ID.
  4. Data processing agreement - Ensure your TraceKit DPA covers session replay data.
  5. Privacy policy - Update your privacy policy to mention session recording.

Conditional initialization based on consent:

import { init } from '@tracekit/browser';
import { replayIntegration } from '@tracekit/replay';

// Only add replay if user has consented
const addons = [];
if (userHasConsentedToRecording()) {
  addons.push(replayIntegration({
    blockMedia: true,
  }));
}

init({
  apiKey: import.meta.env.VITE_TRACEKIT_API_KEY,
  serviceName: 'my-frontend-app',
  endpoint: 'https://app.tracekit.dev',
  addons,
});

Step 4: Sampling Configuration

Control how many sessions are recorded to manage storage costs and volume.

const replay = replayIntegration({
  sessionSampleRate: 0.1,   // Record 10% of all sessions
  errorSampleRate: 0.5,     // Use 50% of remaining budget for error buffer capture
});

Three-Mode Sampling System

The SDK uses a three-mode system based on a random roll at session start:

ModeRangeBehavior
session[0, sessionSampleRate)Full recording - all events forwarded immediately for upload.
buffer[sessionSampleRate, sessionSampleRate + errorSampleRate)Error capture - events stored in a 60-second ring buffer. If an error occurs, the buffer is flushed and mode switches to session for continued recording.
off[sessionSampleRate + errorSampleRate, 1.0]No recording - events are discarded. No recording pipeline is set up.

Important: sessionSampleRate + errorSampleRate must not exceed 1.0. If it does, the SDK clamps errorSampleRate automatically.

SettingDefaultPurpose
sessionSampleRate0.1 (10%)Fraction of sessions that get full recording from the start.
errorSampleRate0.0 (0%)Fraction of sessions that capture errors via ring buffer. Set higher to catch errors in sessions that were not selected for full recording.

How it works:

  • At session start, a random number determines the mode: session, buffer, or off
  • In buffer mode, events are kept in a 60-second ring buffer
  • If an error occurs during a buffer session, all buffered events are flushed and recording switches to full session mode
  • In session mode, events are forwarded immediately to the compression and upload pipeline

Cost implications:

  • Higher sessionSampleRate = more storage = higher bill
  • Start with 0.1 (10%) for general sessions and increase errorSampleRate to catch errors
  • Adjust based on traffic volume and budget

Additional Replay Settings

SettingDefaultDescription
idleTimeout1800000 (30 min)Idle timeout in ms before the session ends. After timeout, pending events are flushed, a new session ID is generated, and a new sampling decision is made.
flushInterval30000 (30s)Interval in ms between automatic uploads of recorded events.
maxBufferSize24117248 (23MB)Maximum buffer size in bytes for pending events before forced flush.

Step 5: Manual Control Methods

The replayIntegration() function returns an integration object with two manual control methods:

const replay = replayIntegration({
  sessionSampleRate: 0.1,
});

// Force an immediate upload of pending events (useful before page transitions)
replay.flush();

// Get the current session ID (useful for linking to support tickets or logs)
const sessionId = replay.getSessionId();  // Returns '' if replay is not active

Use cases for flush():

  • Before a known page navigation to ensure events are sent
  • At critical user actions (e.g., checkout completion)

Use cases for getSessionId():

  • Including session ID in support tickets
  • Logging session ID alongside server-side traces
  • Building custom "View Replay" links in internal tools

Step 6: Linking Replays to Traces

When both session replay and distributed tracing are enabled, they are linked automatically. The SDK injects a replay_id tag on error events so the playback UI can link errors to their replay session. No additional configuration needed.

View a Replay from a Trace

  1. Open a trace in https://app.tracekit.dev/traces
  2. If the trace originated from a browser session with replay, a "View Replay" button appears in the trace detail header
  3. Click to jump to the replay at the exact moment the traced request occurred

View a Trace from a Replay

  1. Open a replay in https://app.tracekit.dev/replays
  2. The replay timeline shows event markers for errors, network requests, and console logs
  3. Click any event marker to see details, including the Trace ID
  4. Click the Trace ID to jump to the full distributed trace waterfall

Filter Replays

Use the replay list to find specific sessions:

  • By error type - find all sessions where a specific error occurred
  • By user - find all sessions for a specific user (requires setUser() in SDK)
  • By time range - find sessions during an incident window
  • By URL - find sessions that visited a specific page

Step 7: Verification

Verify session replay is working:

  1. Start your application with replay configured
  2. Set sessionSampleRate: 1.0 during testing to ensure every session is recorded
  3. Navigate through a few pages and interact with the UI (clicks, form inputs, page transitions)
  4. Visit https://app.tracekit.dev/replays
  5. Find your session in the replay list (most recent, filtered by your user or time)
  6. Click to play the replay
  7. Verify privacy settings:

- Text should appear as asterisks matching the original text length (e.g., "Hello" shows as "*****") - Images and videos should be blocked/replaced with placeholders (if blockMedia: true) - Form inputs should be masked - Any elements with data-tracekit-unmask or matching unmask selectors should show real text

  1. Click an error marker (if any) to verify it links to a distributed trace

Troubleshooting

Replays not appearing

  • Check sampling rate - sessionSampleRate: 0.1 means only 10% of sessions are recorded. Set to 1.0 during testing.
  • Check replay integration is added - verify @tracekit/replay is in package.json and replayIntegration() is passed to addons.
  • Check browser console for errors from the TraceKit SDK. Enable debug: true in init config for verbose logging.
  • Check Content Security Policy - CSP must allow connections to https://app.tracekit.dev.

All text visible (not masked)

  • Text and input masking is always on. If text is showing unmasked, check:

- The unmask config option is not too broad (e.g., do not use unmask: ['*']) - Elements do not have the data-tracekit-unmask attribute applied too widely - Rebuild and redeploy - config changes require a new deployment to take effect

Session ending unexpectedly

  • Check idleTimeout - default is 30 minutes of inactivity. After timeout, the session ends, events are flushed, and a new session starts with a fresh sampling decision.
  • Check visibility handling - recording pauses when the tab is hidden and resumes when visible. This is automatic.
  • Check if user navigated away - replay stops when the user closes the tab or navigates to an external site.

Large replay file sizes

  • Lower sessionSampleRate to reduce total recorded sessions.
  • Keep blockMedia: true (default) to exclude images and videos from recordings.
  • Keep inlineImages: false (default) to avoid base64-encoded images in the payload.
  • Check maxBufferSize - default is 23MB. The SDK flushes when this limit is reached.

Complete Configuration Reference

import { init } from '@tracekit/browser';
import { replayIntegration } from '@tracekit/replay';

const replay = replayIntegration({
  // Sampling
  sessionSampleRate: 0.1,     // 0.0-1.0, default: 0.1 (10% full recording)
  errorSampleRate: 0.0,       // 0.0-1.0, default: 0.0 (error buffer capture rate)

  // Privacy
  blockMedia: true,            // Block img/video/canvas/svg/iframe, default: true
  inlineImages: false,         // Inline images as base64, default: false
  unmask: [],                  // CSS selectors to unmask, default: []
  // Note: text masking and input masking are always on (not configurable)
  // Use data-tracekit-unmask attribute or unmask selectors to show specific text

  // Timing
  idleTimeout: 1800000,        // 30 min idle before session ends, default: 1800000
  flushInterval: 30000,        // Upload interval in ms, default: 30000
  maxBufferSize: 24117248,     // Max buffer size in bytes (23MB), default: 24117248
});

init({
  apiKey: import.meta.env.VITE_TRACEKIT_API_KEY,
  serviceName: 'my-frontend-app',
  endpoint: 'https://app.tracekit.dev',
  addons: [replay],
});

// Manual control
replay.flush();                // Force immediate upload
replay.getSessionId();         // Get current session ID ('' if inactive)

Next Steps

Once session replay is working, consider:

  • Source Maps (tracekit-source-maps skill) - See readable stack traces in replay error markers instead of minified code
  • Alerts (tracekit-alerts skill) - Get notified when replay-captured errors spike

References

  • Session replay docs: https://app.tracekit.dev/docs/frontend/session-replay
  • TraceKit docs root: https://app.tracekit.dev/docs
  • Dashboard: https://app.tracekit.dev

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.25%
按下载量换算20

Claude

31.82%
按下载量换算20

Cursor

20.53%
按下载量换算13

Gemini CLI

9.91%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills