{"_id":"@allstak/browser","_rev":"5-974c470d6a182545ac7949ad07882acd","name":"@allstak/browser","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.1":{"name":"@allstak/browser","version":"0.1.1","keywords":["allstak","observability","browser","error-tracking"],"license":"MIT","_id":"@allstak/browser@0.1.1","maintainers":[{"name":"allstak-","email":"info@allstak.io"}],"homepage":"https://allstak.sa","bugs":{"url":"https://github.com/allstak-io/allstak-browser/issues"},"dist":{"shasum":"d081a73e8da50a26b5a53703fc214bdad3e2dc6c","tarball":"https://registry.npmjs.org/@allstak/browser/-/browser-0.1.1.tgz","fileCount":9,"integrity":"sha512-rs9uf3GVboDNiT4yuFPdv4Q9QBGWNMe0Vvyovpql534KHHF/UJfNKdHXUZhreP09+evEdRYWYo3VcTeQ7BbECw==","signatures":[{"sig":"MEQCIBIdRrEvKjzXcr6sN/qUxpe9RxeuLVUuBhdr+Ne7EimWAiBfI02tYm+iaN4WqzAr6TDkSzckUDShimLch05D682ecA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12183},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"b7342cd6a2ebf485e0dabe8246ae5d0fdc9ff315","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean --sourcemap --platform browser","typecheck":"tsc --noEmit"},"_npmUser":{"name":"allstak-","email":"info@allstak.io"},"deprecated":"This package is deprecated. Use @allstak/js instead.","repository":{"url":"git+https://github.com/allstak-io/allstak-browser.git","type":"git"},"_npmVersion":"10.9.3","description":"AllStak browser SDK — window.onerror, unhandledrejection, fetch instrumentation, and session tracking. Depends on @allstak-io/core.","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@allstak/js":"^0.1.1","@allstak/core":"^0.1.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/browser_0.1.1_1776956221290_0.5064664749554308","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@allstak/browser","version":"0.1.2","keywords":["allstak","observability","browser","error-tracking"],"license":"MIT","_id":"@allstak/browser@0.1.2","maintainers":[{"name":"allstak-","email":"info@allstak.io"}],"homepage":"https://allstak.sa","bugs":{"url":"https://github.com/allstak-io/allstak-browser/issues"},"dist":{"shasum":"a27397a1f23b6bfb36dd20b27a7cfdf8e8e111be","tarball":"https://registry.npmjs.org/@allstak/browser/-/browser-0.1.2.tgz","fileCount":9,"integrity":"sha512-hCgHLsN9YIrrO2AAypqdItcG21FrP14nlMLtHuJJm49zquIapZuoNcPVCDGii7BhlkLRag6g3h8a/aP4PI2rag==","signatures":[{"sig":"MEUCIHBEGBFpYmkLMaGQEiYd/aSaBtfF7SNyPUuoUXzVk2SvAiEA8NVQXr2JWmriJIhZpVwWog3ad+PVTndvOZrpjs57dK8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12183},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"b7342cd6a2ebf485e0dabe8246ae5d0fdc9ff315","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean --sourcemap --platform browser","typecheck":"tsc --noEmit"},"_npmUser":{"name":"allstak-","email":"info@allstak.io"},"deprecated":"This package is deprecated. Use @allstak/js instead.","repository":{"url":"git+https://github.com/allstak-io/allstak-browser.git","type":"git"},"_npmVersion":"10.9.3","description":"AllStak browser SDK — window.onerror, unhandledrejection, fetch instrumentation, and session tracking. Depends on @allstak-io/core.","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@allstak/js":"^0.1.2","@allstak/core":"^0.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/browser_0.1.2_1776956698806_0.46627104937333663","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@allstak/browser","version":"0.1.3","keywords":["allstak","observability","browser","error-tracking"],"license":"MIT","_id":"@allstak/browser@0.1.3","maintainers":[{"name":"allstak-","email":"info@allstak.io"}],"homepage":"https://allstak.sa","bugs":{"url":"https://github.com/allstak-io/allstak-browser/issues"},"dist":{"shasum":"99522a7d14d3cce62fc513ab6a6b0f470dc734f2","tarball":"https://registry.npmjs.org/@allstak/browser/-/browser-0.1.3.tgz","fileCount":9,"integrity":"sha512-Zs3Sos4XOk9Jlcgut+6CAG6U3mgSuoIgARMgwaOysmdBaI0sGAdAENWDtMD6La7QHxGRMPhVXO8GSdWuLW8WUg==","signatures":[{"sig":"MEQCIDAvuWvUySVFy2Wl7x7pavCnH/d2EZ8NGHD1peTiHlg3AiBFuzkWuGYT8wgPCB9IVq90cqezsmmy2bM2FFP3plvivQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14206},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"c1bfeafac09bde08323b6ac8e1771f7326ebf1bb","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean --sourcemap --platform browser","typecheck":"tsc --noEmit"},"_npmUser":{"name":"allstak-","email":"info@allstak.io"},"deprecated":"This package is deprecated. Use @allstak/js instead.","repository":{"url":"git+https://github.com/allstak-io/allstak-browser.git","type":"git"},"_npmVersion":"10.9.3","description":"AllStak browser SDK — window.onerror, unhandledrejection, fetch instrumentation, and session tracking. Depends on @allstak-io/core.","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@allstak/js":"^0.1.3","@allstak/core":"^0.1.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/browser_0.1.3_1776960356164_0.05328846656519004","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-23T14:57:01.191Z","modified":"2026-05-11T05:38:35.886Z","0.1.1":"2026-04-23T14:57:01.426Z","0.1.2":"2026-04-23T15:04:58.952Z","0.1.3":"2026-04-23T16:05:56.300Z"},"bugs":{"url":"https://github.com/allstak-io/allstak-browser/issues"},"license":"MIT","homepage":"https://allstak.sa","keywords":["allstak","observability","browser","error-tracking"],"repository":{"url":"git+https://github.com/allstak-io/allstak-browser.git","type":"git"},"description":"AllStak browser SDK — window.onerror, unhandledrejection, fetch instrumentation, and session tracking. Depends on @allstak-io/core.","maintainers":[{"name":"allstak-","email":"info@allstak.io"}],"readme":"# @allstak/browser\n\n**Error tracking and session replay for browser apps. Drop-in, tree-shakable, framework-free.**\n\n[![npm version](https://img.shields.io/npm/v/@allstak/browser.svg)](https://www.npmjs.com/package/@allstak/browser)\n[![CI](https://github.com/allstak-io/allstak-browser/actions/workflows/ci.yml/badge.svg)](https://github.com/allstak-io/allstak-browser/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nOfficial AllStak SDK for browsers and SPAs — captures uncaught errors, console logs, fetch requests, and optional session replay.\n\n## Dashboard\n\nView captured events live at [app.allstak.sa](https://app.allstak.sa).\n\n![AllStak dashboard](https://app.allstak.sa/images/dashboard-preview.png)\n\n## Features\n\n- `window.onerror` + `unhandledrejection` auto-capture\n- `fetch` instrumentation (breadcrumbs + outbound request telemetry)\n- `console.warn` / `console.error` breadcrumbs\n- Optional session replay (DOM + input events, PII masking)\n- User, tag, and trace context helpers\n- Tiny runtime with tree-shakable ES modules\n\n## What You Get\n\nOnce integrated, every event flows to your AllStak dashboard:\n\n- **Errors** — stack traces, breadcrumbs, release + environment tags\n- **Logs** — console warnings and errors as structured breadcrumbs\n- **HTTP** — outbound `fetch` timing, status codes, failed calls\n- **Session replay** — DOM and input playback with PII masking (opt-in)\n- **Alerts** — email and webhook notifications on regressions\n\n## Installation\n\n```bash\nnpm install @allstak/browser\n```\n\n## Quick Start\n\n> Create a project at [app.allstak.sa](https://app.allstak.sa) to get your API key.\n\n```ts\nimport { AllStak } from '@allstak/browser';\n\nAllStak.init({\n  apiKey: import.meta.env.VITE_ALLSTAK_API_KEY,\n  environment: 'production',\n  release: 'web@1.2.0',\n});\n\nAllStak.captureException(new Error('test: hello from allstak-browser'));\n```\n\nOpen the page — the test error appears in your dashboard within seconds.\n\n## Get Your API Key\n\n1. Sign up at [app.allstak.sa](https://app.allstak.sa)\n2. Create a project\n3. Copy your API key from **Project Settings → API Keys**\n4. Export it as `ALLSTAK_API_KEY` or pass it to `AllStak.init(...)`\n\n## Configuration\n\n| Option | Type | Required | Default | Description |\n|---|---|---|---|---|\n| `apiKey` | `string` | yes | — | Project API key (`ask_live_…`) |\n| `environment` | `string` | no | — | Deployment env |\n| `release` | `string` | no | — | Version or git SHA |\n| `host` | `string` | no | `https://api.allstak.sa` | Ingest host override |\n| `user` | `{ id?, email? }` | no | — | Default user context |\n| `tags` | `Record<string,string>` | no | — | Default tags |\n| `autoBreadcrumbs` | `boolean` | no | `true` | Capture fetch/console breadcrumbs |\n| `sessionReplay.enabled` | `boolean` | no | `false` | Enable session replay |\n| `sessionReplay.maskAllInputs` | `boolean` | no | `true` | Mask all `<input>` values |\n| `sessionReplay.sampleRate` | `number` | no | `1.0` | 0.0–1.0 sampling rate |\n\n## Example Usage\n\nCapture an exception:\n\n```ts\nimport { captureException } from '@allstak/browser';\ncaptureException(new Error('Checkout UI broke'));\n```\n\nSend a message:\n\n```ts\nimport { captureMessage } from '@allstak/browser';\ncaptureMessage('Feature flag \"new-nav\" enabled', 'info');\n```\n\nSet user + tag:\n\n```ts\nimport { setUser, setTag } from '@allstak/browser';\nsetUser({ id: 'u_42', email: 'alice@example.com' });\nsetTag('build', 'web-2024.04.23');\n```\n\n## Production Endpoint\n\nProduction endpoint: `https://api.allstak.sa`. Override via `host` only for self-hosted deployments:\n\n```ts\nAllStak.init({ apiKey: '...', host: 'https://allstak.mycorp.com' });\n```\n\n## Links\n\n- Documentation: https://docs.allstak.sa\n- Dashboard: https://app.allstak.sa\n- Source: https://github.com/allstak-io/allstak-browser\n\n## License\n\nMIT © AllStak\n","readmeFilename":"README.md"}