{"_id":"@dysonic/web-replay-sdk-h5","_rev":"2-3ab5053fdc6e81b9eac231191fe6301d","name":"@dysonic/web-replay-sdk-h5","dist-tags":{"beta":"0.1.0-beta.0","latest":"0.1.0"},"versions":{"0.1.0-beta.0":{"name":"@dysonic/web-replay-sdk-h5","version":"0.1.0-beta.0","license":"MIT","_id":"@dysonic/web-replay-sdk-h5@0.1.0-beta.0","maintainers":[{"name":"yuanhongboo","email":"yuanhongboo@gmail.com"}],"dist":{"shasum":"765805fa80daf38a760b5e870d52e13a41699fef","tarball":"https://registry.npmjs.org/@dysonic/web-replay-sdk-h5/-/web-replay-sdk-h5-0.1.0-beta.0.tgz","fileCount":5,"integrity":"sha512-d2rgwtTdshZh/dnA8mfdAakHQ6tL45jXTxeo18U1lMPxuKCbNdnFq0gPR5dWOyL4337eNXVXblxV3nV6towfMg==","signatures":[{"sig":"MEUCIQC1rUrcLSjrsowbhaKfmiHNuWwlVTB9N+1ghMsZ6poLyQIgEwoZ9PMmzEocIu1GD3dakHYbzmBWXm+a5rqNbzaqe0c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7413},"main":"dist/index.cjs.js","_from":"file:dysonic-web-replay-sdk-h5-0.1.0-beta.0.tgz","types":"dist/index.d.ts","module":"dist/index.esm.js","scripts":{"test":"ts-node-script ../../tools/scripts/test.ts --verbose --color","build":"npm run build:cjs && npm run build:esm","clean":"rimraf dist && rimraf coverage","prebuild":"rimraf dist","build:cjs":"ts-node-script ../../tools/scripts/build.ts --mode cjs","build:esm":"ts-node-script ../../tools/scripts/build.ts --mode esm","test:coverage":"ts-node-script ../../tools/scripts/test.ts --coverage"},"_npmUser":{"name":"yuanhongboo","email":"yuanhongboo@gmail.com"},"_resolved":"/private/var/folders/81/zd5db0kd52j_qlwm_kvz2zzc0000gn/T/158e366bc278887fa8e92f2cef1b20b6/dysonic-web-replay-sdk-h5-0.1.0-beta.0.tgz","_integrity":"sha512-d2rgwtTdshZh/dnA8mfdAakHQ6tL45jXTxeo18U1lMPxuKCbNdnFq0gPR5dWOyL4337eNXVXblxV3nV6towfMg==","_npmVersion":"10.8.2","description":"H5 replay SDK built on the shared web replay core","directories":{},"sideEffects":false,"_nodeVersion":"18.20.8","dependencies":{"@dysonic/web-replay-core":"0.1.0-beta.0"},"publishConfig":{"registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/web-replay-sdk-h5_0.1.0-beta.0_1773427489692_0.7465399253907461","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@dysonic/web-replay-sdk-h5","version":"0.1.0","description":"H5 replay SDK built on the shared web replay core","license":"MIT","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","sideEffects":false,"publishConfig":{"registry":"https://registry.npmjs.org"},"dependencies":{"@dysonic/web-replay-core":"0.1.0"},"scripts":{"build":"npm run build:cjs && npm run build:esm","build:cjs":"ts-node-script ../../tools/scripts/build.ts --mode cjs","build:esm":"ts-node-script ../../tools/scripts/build.ts --mode esm","test":"ts-node-script ../../tools/scripts/test.ts --verbose --color","test:coverage":"ts-node-script ../../tools/scripts/test.ts --coverage","clean":"rimraf dist && rimraf coverage","prebuild":"rimraf dist"},"_id":"@dysonic/web-replay-sdk-h5@0.1.0","_integrity":"sha512-ZAXKBCm2LnW+97wnrdKBGnHLd5gIUGN4GJLySduY0koq6PrkJ/kWH+os+inxJDcbg3acozjMuiuUigFOHQZWTA==","_resolved":"/tmp/8fda56a864f9c1ece288014ed9593268/dysonic-web-replay-sdk-h5-0.1.0.tgz","_from":"file:dysonic-web-replay-sdk-h5-0.1.0.tgz","_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ZAXKBCm2LnW+97wnrdKBGnHLd5gIUGN4GJLySduY0koq6PrkJ/kWH+os+inxJDcbg3acozjMuiuUigFOHQZWTA==","shasum":"80c44ffec71bf5de017ff72fb3b06ddd2b4d6378","tarball":"https://registry.npmjs.org/@dysonic/web-replay-sdk-h5/-/web-replay-sdk-h5-0.1.0.tgz","fileCount":5,"unpackedSize":7399,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCWpUTVRnVM2rw1dqdtzRPx9FftC+uaNFu72pt3jrTvpwIgBif7ABPWaFmQbtf/nP+Q+ejE72ForoSwyVkScIVvKgI="}]},"_npmUser":{"name":"yuanhongboo","email":"yuanhongboo@gmail.com"},"directories":{},"maintainers":[{"name":"yuanhongboo","email":"yuanhongboo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web-replay-sdk-h5_0.1.0_1773430617674_0.9864839751584744"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-13T18:44:49.626Z","modified":"2026-03-13T19:36:57.935Z","0.1.0-beta.0":"2026-03-13T18:44:49.837Z","0.1.0":"2026-03-13T19:36:57.814Z"},"license":"MIT","description":"H5 replay SDK built on the shared web replay core","maintainers":[{"name":"yuanhongboo","email":"yuanhongboo@gmail.com"}],"readme":"# @dysonic/web-replay-sdk-h5\n\nH5/mobile replay SDK. Records user sessions using a custom event adapter pattern built on top of `@dysonic/web-replay-core`, and exports a `ReplayEnvelope` for playback and issue reporting.\n\nUnlike the PC SDK, this package does **not** bundle rrweb — you supply the event source via `recordEvent()`. This keeps the bundle small and lets you plug in any capture mechanism suited to your H5 environment.\n\n## Installation\n\n```bash\nnpm install @dysonic/web-replay-sdk-h5\n```\n\n## Quick Start\n\n```typescript\nimport { createWebSdk } from '@dysonic/web-replay-sdk-h5';\n\nconst sdk = createWebSdk({\n  appName: 'my-h5-app',\n  appVersion: '2.1.0',\n  maxMinutes: 5,\n  reporter: {\n    async report({ envelope, reason, extra }) {\n      await fetch('/api/replay', {\n        method: 'POST',\n        body: JSON.stringify({ envelope, reason, extra }),\n      });\n    },\n  },\n});\n\nsdk.init();\n\n// Feed events from your capture mechanism:\nyourCapture.on('event', (e) => sdk.recordEvent(e));\n\n// Report an issue:\nconst envelope = await sdk.reportIssue('Blank screen after tap');\n```\n\n## API\n\n### `createWebSdk(config)`\n\nCreates and returns a `WebSdkInstance`. Recording does not begin until `init()` is called.\n\n```typescript\ninterface WebSdkConfig<TEvent = unknown> {\n  appName: string;\n  appVersion: string;\n  maxMinutes?: number;      // default: 5, max: 10\n  maxBytes?: number;        // default: 5 MB\n  maskRules?: MaskRule[];   // CSS-selector-based field masking\n  now?: () => number;       // injectable clock (useful in tests)\n  reporter?: Reporter<TEvent>;\n}\n```\n\n#### Instance methods\n\n| Method | Description |\n|---|---|\n| `init()` | Start the session and write the initial lifecycle marker. |\n| `pause()` | Pause buffering; events passed to `recordEvent()` are discarded. |\n| `resume()` | Resume buffering. |\n| `recordEvent(event, timestamp?)` | Push an event into the buffer. Events queued before `init()` are flushed automatically on start. |\n| `reportIssue(reason?, extra?)` | Flush the buffer, call the reporter, and return the `ReplayEnvelope`. |\n| `destroy()` | Stop recording and clear the buffer. |\n\n#### Pre-init event queue\n\nEvents recorded via `recordEvent()` before `init()` is called are held in a queue and automatically replayed into the buffer the moment the adapter starts. This means you can safely call `recordEvent()` at any point during application boot.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}