{"_id":"@argusdev/sdk-svelte","name":"@argusdev/sdk-svelte","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@argusdev/sdk-svelte","version":"0.3.0","description":"Argus SDK for SvelteKit — handleError hooks for client and server, on top of @argusdev/sdk-browser.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./client":{"types":"./dist/client.d.ts","import":"./dist/client.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js"}},"dependencies":{"@argusdev/sdk-core":"0.3.0","@argusdev/sdk-browser":"0.3.0"},"devDependencies":{"typescript":"~6.0.3"},"license":"MIT","author":"Treasure Odetokun","homepage":"https://github.com/oluwatobicode/argus#readme","keywords":["argus","error-tracking","monitoring","sdk","svelte","sveltekit"],"repository":{"type":"git","url":"git+https://github.com/oluwatobicode/argus.git","directory":"packages/sdk-svelte"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","dev":"tsc --watch","typecheck":"tsc --noEmit","test":"node --test"},"_nodeVersion":"24.18.0","_id":"@argusdev/sdk-svelte@0.3.0","dist":{"integrity":"sha512-YDW9Q0S32b7oyrqBQ79+B5lNBGHWyp99+tq1GgqEaK/N01IX0JaI6AEEU0BsT6JVrBa7wDUISoD6WSwOS4cbFA==","shasum":"c29192587fe6548a29350b8dfed66185189fef83","tarball":"https://registry.npmjs.org/@argusdev/sdk-svelte/-/sdk-svelte-0.3.0.tgz","fileCount":17,"unpackedSize":17097,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDvK9mWU4GFRZ5TX4mP4SPEOpiBzzqWwxXIzM7GerfyWgIgQ1j6hBf9xZRcGFcghTJWiFujxVtFnQTe+hfeYIz4OT4="}]},"_npmUser":{"name":"oluwatobicodes","email":"odetokuntreasure6@gmail.com"},"directories":{},"maintainers":[{"name":"oluwatobicodes","email":"odetokuntreasure6@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-svelte_0.3.0_1786963792166_0.10852108039197983"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T10:49:51.878Z","0.3.0":"2026-08-17T10:49:52.326Z","modified":"2026-08-17T10:49:53.380Z"},"maintainers":[{"name":"oluwatobicodes","email":"odetokuntreasure6@gmail.com"}],"description":"Argus SDK for SvelteKit — handleError hooks for client and server, on top of @argusdev/sdk-browser.","homepage":"https://github.com/oluwatobicode/argus#readme","keywords":["argus","error-tracking","monitoring","sdk","svelte","sveltekit"],"repository":{"type":"git","url":"git+https://github.com/oluwatobicode/argus.git","directory":"packages/sdk-svelte"},"author":"Treasure Odetokun","license":"MIT","readme":"# @argusdev/sdk-svelte\n\nSvelteKit SDK for [Argus](https://github.com/oluwatobicode/argus) — `handleError` wrappers for both hooks files, on top of `@argusdev/sdk-browser`. SvelteKit routes every unexpected error through `handleError`; they never reach `window.onerror` or process handlers.\n\n## Install\n\n```bash\nnpm install @argusdev/sdk-svelte\n```\n\n## Usage\n\n```ts\n// hooks.server.ts\nimport { init, handleErrorWithArgus } from \"@argusdev/sdk-svelte/server\";\n\ninit({ dsn: \"https://<publicKey>@<host>/<projectId>\", environment: \"production\" });\n\nexport const handleError = handleErrorWithArgus();\n```\n\n```ts\n// hooks.client.ts\nimport { init, handleErrorWithArgus } from \"@argusdev/sdk-svelte/client\";\n\ninit({ dsn: \"https://<publicKey>@<host>/<projectId>\" });\n\nexport const handleError = handleErrorWithArgus();\n```\n\nThe client `init()` also gives you `window.onerror`, unhandled rejections, and web vitals — the wrapper covers what SvelteKit swallows (`load` failures, navigation errors, form actions, endpoints, rendering).\n\n## Keeping your own handleError\n\nPass it in — it still runs, and its return value (the shape `$page.error` gets) is preserved:\n\n```ts\nexport const handleError = handleErrorWithArgus(({ error, event }) => {\n  return { message: \"Whoops!\" };\n});\n```\n\nBoth wrappers satisfy SvelteKit's own `HandleServerError` / `HandleClientError` types:\n\n```ts\nimport type { HandleServerError } from \"@sveltejs/kit\";\nexport const handleError: HandleServerError = handleErrorWithArgus();\n```\n\n## What gets attached\n\n| Tag                | Example          |\n| ------------------ | ---------------- |\n| `routeId`          | `/blog/[slug]`   |\n| `status`           | `500`            |\n| `sveltekitMessage` | `Internal Error` |\n\n`routeId` is the dynamic **pattern**, stable across requests — the tag worth filtering the dashboard by. Server events also carry `request` context (pathname, method, `user-agent`). Cookies and `authorization` are never forwarded.\n\n**404s are skipped** — unmatched routes reach `handleError` too, and they're traffic noise, not crashes. Your own handler still runs for them.\n\n## Two entry points\n\n| Import                        | Use in            |\n| ----------------------------- | ----------------- |\n| `@argusdev/sdk-svelte/server` | `hooks.server.ts` |\n| `@argusdev/sdk-svelte/client` | `hooks.client.ts` |\n\nThe server entry never imports `sdk-browser` and uses no Node built-ins — it runs on edge deployments as-is. No `@sveltejs/kit` dependency: the wrappers are typed structurally, so any Kit 2.x works.\n\nMIT © Treasure Odetokun\n","readmeFilename":"","_rev":"1-e1639d543c35cbd7b975c18f8ee0d646"}