{"_id":"@arguslog/sdk-core","_rev":"5-79fe24712fa8bd793517e6e8f45d6080","name":"@arguslog/sdk-core","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@arguslog/sdk-core","version":"1.0.0","license":"MIT","_id":"@arguslog/sdk-core@1.0.0","maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"dist":{"shasum":"0e6f7d7d69622bee1c24b53af0145279157a6c65","tarball":"https://registry.npmjs.org/@arguslog/sdk-core/-/sdk-core-1.0.0.tgz","fileCount":34,"integrity":"sha512-IfEFrMsuiJp2WjysBX1eNbuFTzGZaqSotkrMrttFPFWqLDOhi/bTWntu3NFZTEqU6auVLM1GwZZwK7IwHNoZ/A==","signatures":[{"sig":"MEUCIQDRQ+MTVq/HvDAfY1+Y2zWuK4FupVem4X2iBA5eo6XmNgIgeZMgQGh1iM9FugEOXjqeEhv1KuEbhY2O/ilASP791XI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43312},"main":"./dist/index.js","type":"module","_from":"file:arguslog-sdk-core-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint src","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist .turbo","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"},"_resolved":"/tmp/8e810c6f8d62a86ff028dbc31ae6f479/arguslog-sdk-core-1.0.0.tgz","_integrity":"sha512-IfEFrMsuiJp2WjysBX1eNbuFTzGZaqSotkrMrttFPFWqLDOhi/bTWntu3NFZTEqU6auVLM1GwZZwK7IwHNoZ/A==","_npmVersion":"10.9.7","description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.18.0","vitest":"^3.2.4","typescript":"^5.7.0","@arguslog/tsconfig":"0.0.0","@vitest/coverage-v8":"^3.2.4","@arguslog/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-core_1.0.0_1778254094431_0.5173710514990586","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arguslog/sdk-core","version":"1.0.1","license":"MIT","_id":"@arguslog/sdk-core@1.0.1","maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"dist":{"shasum":"be9a344b8f77e1d14c42efad0318f76e876e42d5","tarball":"https://registry.npmjs.org/@arguslog/sdk-core/-/sdk-core-1.0.1.tgz","fileCount":35,"integrity":"sha512-B6h/m2O/ld+sMPGX50ulesozjWWucOgUmGWkVJ1y1HklcLQNnNkR3y7NkCz0yPGjDjTnyJulbYUiqXwj7SqJzw==","signatures":[{"sig":"MEYCIQDjUoe4e85crlOZc01rZeivLONKKHXgGIXoPgyI4PNLJwIhAPuuyhVr5KiUYQgtwRJ9EwuRaJA1ZDI/ihp40qldmjUz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53099},"main":"./dist/index.js","type":"module","_from":"file:arguslog-sdk-core-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint src","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist .turbo","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"},"_resolved":"/tmp/70b5ca3289d273197bdc712f606c4b9f/arguslog-sdk-core-1.0.1.tgz","_integrity":"sha512-B6h/m2O/ld+sMPGX50ulesozjWWucOgUmGWkVJ1y1HklcLQNnNkR3y7NkCz0yPGjDjTnyJulbYUiqXwj7SqJzw==","_npmVersion":"10.9.7","description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.18.0","vitest":"^3.2.4","typescript":"^5.7.0","@arguslog/tsconfig":"0.0.0","@vitest/coverage-v8":"^3.2.4","@arguslog/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-core_1.0.1_1778261361741_0.6298926970824117","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@arguslog/sdk-core","version":"1.0.2","license":"MIT","_id":"@arguslog/sdk-core@1.0.2","maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"dist":{"shasum":"f0c2fe1498a06e5c1f9ddbbf54fdb8820ea72c01","tarball":"https://registry.npmjs.org/@arguslog/sdk-core/-/sdk-core-1.0.2.tgz","fileCount":39,"integrity":"sha512-3l4uO2IaiHIk0lTHreADmTp1asmXpvWHXmhCuucUr9aHOsBXqGtUO45DUY9TRDwiEX1TaBb70+H4wja14YdRcg==","signatures":[{"sig":"MEYCIQD9ODw8yvzcRdrvAgh+SeWEqHyRbl96meC8EBP/X8DH9wIhAPtct33AmZM1BZ89fhQZG1tdKsBxlauee0xjX4XMSzFQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56628},"main":"./dist/index.js","type":"module","_from":"file:arguslog-sdk-core-1.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint src","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist .turbo","predev":"node scripts/gen-version.mjs","pretest":"node scripts/gen-version.mjs","prebuild":"node scripts/gen-version.mjs","typecheck":"tsc --noEmit","gen-version":"node scripts/gen-version.mjs","pretypecheck":"node scripts/gen-version.mjs","test:coverage":"vitest run --coverage","pretest:coverage":"node scripts/gen-version.mjs"},"_npmUser":{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"},"_resolved":"/tmp/e12152bbe04cdf51738e2da06c2b7be1/arguslog-sdk-core-1.0.2.tgz","_integrity":"sha512-3l4uO2IaiHIk0lTHreADmTp1asmXpvWHXmhCuucUr9aHOsBXqGtUO45DUY9TRDwiEX1TaBb70+H4wja14YdRcg==","_npmVersion":"10.9.7","description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.18.0","vitest":"^3.2.4","typescript":"^5.7.0","@arguslog/tsconfig":"0.0.0","@vitest/coverage-v8":"^3.2.4","@arguslog/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-core_1.0.2_1778358042453_0.38238985825340444","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@arguslog/sdk-core","version":"2.0.0","license":"MIT","_id":"@arguslog/sdk-core@2.0.0","maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"homepage":"https://arguslog.org","bugs":{"url":"https://github.com/petarnenov/arguslog-sdks/issues"},"dist":{"shasum":"f7e56cc0f3361d562e91b03862b58021fb1dc419","tarball":"https://registry.npmjs.org/@arguslog/sdk-core/-/sdk-core-2.0.0.tgz","fileCount":40,"integrity":"sha512-Lik2DqfglttLB1s9dN+ydB28suYy6wtwj2OsRCCsGkFUIfi8mqKT5xHXHTLjg5oIeXweCy+4SoHOd7pUYBwwrA==","signatures":[{"sig":"MEUCIF5nHuf3qXbw/J2i2gYRDOfGtYdhLpJIroJyzGPlvt+KAiEAg9msiFFN4nl5TrEzFnmLrkD9jr9XzOE8UpX/I8cs+n8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57328},"main":"./dist/index.js","type":"module","_from":"file:arguslog-sdk-core-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.build.json --watch","lint":"eslint src","test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist .turbo","predev":"node scripts/gen-version.mjs","pretest":"node scripts/gen-version.mjs","prebuild":"node scripts/gen-version.mjs","typecheck":"tsc --noEmit","gen-version":"node scripts/gen-version.mjs","pretypecheck":"node scripts/gen-version.mjs","test:coverage":"vitest run --coverage","pretest:coverage":"node scripts/gen-version.mjs"},"_npmUser":{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"},"_resolved":"/tmp/dc8d40bac8298e1ab46192e750968cdb/arguslog-sdk-core-2.0.0.tgz","_integrity":"sha512-Lik2DqfglttLB1s9dN+ydB28suYy6wtwj2OsRCCsGkFUIfi8mqKT5xHXHTLjg5oIeXweCy+4SoHOd7pUYBwwrA==","repository":{"url":"git+https://github.com/petarnenov/arguslog-sdks.git","type":"git","directory":"packages/sdk-core"},"_npmVersion":"10.9.7","description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.18.0","vitest":"^3.2.4","typescript":"^5.7.0","@arguslog/tsconfig":"0.0.0","@vitest/coverage-v8":"^3.2.4","@arguslog/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-core_2.0.0_1778619530205_0.1509510969404404","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@arguslog/sdk-core","version":"2.0.1","description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","license":"MIT","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"sideEffects":false,"devDependencies":{"@vitest/coverage-v8":"^3.2.4","eslint":"^9.18.0","typescript":"^5.7.0","vitest":"^3.2.4","@arguslog/eslint-config":"0.0.0","@arguslog/tsconfig":"0.0.0"},"repository":{"type":"git","url":"git+https://github.com/petarnenov/arguslog-sdks.git","directory":"packages/sdk-core"},"homepage":"https://arguslog.org","bugs":{"url":"https://github.com/petarnenov/arguslog-sdks/issues"},"scripts":{"gen-version":"node scripts/gen-version.mjs","prebuild":"node scripts/gen-version.mjs","predev":"node scripts/gen-version.mjs","pretest":"node scripts/gen-version.mjs","pretest:coverage":"node scripts/gen-version.mjs","pretypecheck":"node scripts/gen-version.mjs","build":"tsc -p tsconfig.build.json","dev":"tsc -p tsconfig.build.json --watch","lint":"eslint src","typecheck":"tsc --noEmit","test":"vitest run","test:coverage":"vitest run --coverage","clean":"rm -rf dist .turbo"},"_id":"@arguslog/sdk-core@2.0.1","_integrity":"sha512-rxBvrrfPBY1LSn36OK3rC2f+XSeYW8nEjQUw/a5tZ8ciowoVdF9brh9QUhppTFJVTlEHiEBxy9f9O7rT7lV2aQ==","_resolved":"/tmp/51fa425c0b2e80dace04600319a3adb9/arguslog-sdk-core-2.0.1.tgz","_from":"file:arguslog-sdk-core-2.0.1.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-rxBvrrfPBY1LSn36OK3rC2f+XSeYW8nEjQUw/a5tZ8ciowoVdF9brh9QUhppTFJVTlEHiEBxy9f9O7rT7lV2aQ==","shasum":"a6c7d79ec589e4055de6845bd568cf387424b7c6","tarball":"https://registry.npmjs.org/@arguslog/sdk-core/-/sdk-core-2.0.1.tgz","fileCount":44,"unpackedSize":62077,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAeqTAZOjKArLc5z3qIkAJ93CHBrRZqoo4OxYCZ6Zcj+AiBoJgQrQogHnlB7GfYIM90WvZ+K59uiift/sXEvu1xFQA=="}]},"_npmUser":{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"},"directories":{},"maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-core_2.0.1_1778780489266_0.42613938268373097"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T15:28:14.321Z","modified":"2026-05-14T17:41:29.613Z","1.0.0":"2026-05-08T15:28:14.570Z","1.0.1":"2026-05-08T17:29:21.914Z","1.0.2":"2026-05-09T20:20:42.597Z","2.0.0":"2026-05-12T20:58:50.345Z","2.0.1":"2026-05-14T17:41:29.435Z"},"bugs":{"url":"https://github.com/petarnenov/arguslog-sdks/issues"},"license":"MIT","homepage":"https://arguslog.org","repository":{"type":"git","url":"git+https://github.com/petarnenov/arguslog-sdks.git","directory":"packages/sdk-core"},"description":"Arguslog SDK core — platform-agnostic event pipeline shared by sdk-browser and sdk-node","maintainers":[{"name":"petar.nenov","email":"petarnenovpetrov@gmail.com"}],"readme":"# @arguslog/sdk-core\n\n[![npm version](https://img.shields.io/npm/v/@arguslog/sdk-core.svg)](https://www.npmjs.com/package/@arguslog/sdk-core)\n[![license](https://img.shields.io/npm/l/@arguslog/sdk-core.svg)](https://github.com/petarnenov/arguslog/blob/main/LICENSE)\n\nPlatform-agnostic foundation for the [Arguslog](https://arguslog.org) SDKs. Holds the\nevent pipeline (DSN parsing, scope, breadcrumbs, scrubbing, transport, retry/backoff) so\neach platform package — `@arguslog/sdk-browser`, `@arguslog/sdk-node`, `@arguslog/sdk-react`,\n`@arguslog/sdk-vue`, `@arguslog/sdk-angular`, `@arguslog/sdk-react-native`,\n`@arguslog/sdk-nextjs` — can stay thin and just contribute a `PlatformAdapter` plus a\n`StackParser`.\n\nShips ESM only. No runtime dependencies.\n\n> **You probably don't want this directly.** If you're building a normal app, install\n> `@arguslog/sdk-browser`, `@arguslog/sdk-node`, or one of the framework packages — they\n> pull in `sdk-core` as a transitive dep and give you a much friendlier surface.\n>\n> Use `@arguslog/sdk-core` directly when you're writing a **new platform integration**\n> (e.g. Bun, Deno, Workers, Electron main process, Lambda runtime) and want to share the\n> battle-tested pipeline instead of reinventing it.\n\n## Install\n\n```bash\npnpm add @arguslog/sdk-core\n# or\nnpm install @arguslog/sdk-core\n# or\nyarn add @arguslog/sdk-core\n```\n\n## What's in the box\n\n| Export             | Kind  | Purpose                                                                        |\n| ------------------ | ----- | ------------------------------------------------------------------------------ |\n| `ArguslogClient`   | class | The event pipeline. Everything routes through here.                            |\n| `parseDsn`         | fn    | Parses an `arguslog://key@host/api/projectId` DSN into a `ParsedDsn`.          |\n| `InvalidDsnError`  | class | Thrown by `parseDsn` for malformed input.                                      |\n| `Transport`        | class | Sends `EventPayload`s to the ingest endpoint with retry/backoff.               |\n| `Scrubber`         | class | PII redaction (emails, IPs, credit-card numbers, custom regexes).              |\n| `BreadcrumbBuffer` | class | Bounded ring buffer for breadcrumbs.                                           |\n| `GlobalScope`      | class | Default `ScopeStore` — single shared user/tags/contexts/breadcrumbs.           |\n| `ScopeStore`       | type  | Interface platform adapters implement to swap in per-request scope (sdk-node). |\n| `PlatformAdapter`  | type  | What each platform package contributes to the client.                          |\n| `StackParser`      | type  | `(stack: string \\| undefined) => StackFrame[]` — platforms ship one.           |\n| Event/option types | type  | `ArguslogOptions`, `EventPayload`, `Breadcrumb`, `User`, `Level`, …            |\n| `SDK_VERSION`      | const | Semver of the published `sdk-core` build, stamped on every event.              |\n\n## Building a platform integration\n\nThree pieces wire `sdk-core` to a new platform:\n\n1. A **`PlatformAdapter`** that names the SDK and (optionally) enriches events with\n   platform-only fields.\n2. A **`StackParser`** that turns a raw `Error.stack` string into `StackFrame[]` for the\n   target runtime.\n3. Optionally, a custom **`ScopeStore`** if the platform supports per-request scope\n   (e.g. async-context based isolation in a server runtime).\n\n### Minimal example — Bun runtime adapter\n\n```ts\nimport {\n  ArguslogClient,\n  type ArguslogOptions,\n  type EventPayload,\n  type PlatformAdapter,\n  type StackParser,\n  type StackFrame,\n} from '@arguslog/sdk-core';\n\nconst bunAdapter: PlatformAdapter = {\n  sdkName: 'arguslog.bun',\n  platform: 'node', // closest match in the existing taxonomy\n  enrichEvent(event: EventPayload) {\n    event.contexts = {\n      ...(event.contexts ?? {}),\n      runtime: { name: 'bun', version: Bun.version },\n    };\n  },\n};\n\n// Cheap-and-cheerful stack parser. Real platforms ship a more thorough one — see how\n// sdk-node and sdk-browser do it in the monorepo.\nconst parseStack: StackParser = (stack) => {\n  if (!stack) return [];\n  const frames: StackFrame[] = [];\n  for (const raw of stack.split('\\n')) {\n    const m = /at (?:(.+?) )?\\(?(.+?):(\\d+):(\\d+)\\)?/.exec(raw);\n    if (m) {\n      frames.push({\n        function: m[1] || '<anonymous>',\n        filename: m[2],\n        lineno: Number(m[3]),\n        colno: Number(m[4]),\n        inApp: !m[2].includes('node_modules'),\n      });\n    }\n  }\n  return frames.reverse(); // oldest frame first\n};\n\nexport function init(options: ArguslogOptions): ArguslogClient {\n  return new ArguslogClient(options, { adapter: bunAdapter, parseStack });\n}\n```\n\nConsumer code:\n\n```ts\nimport { init } from './arguslog-bun.js';\n\nconst client = init({\n  dsn: 'arguslog://<key>@<host>/api/<projectId>',\n  release: process.env.RELEASE,\n  environment: 'production',\n});\n\ntry {\n  await riskyThing();\n} catch (err) {\n  client.captureException(err, { tags: { feature: 'checkout' } });\n}\n\nawait client.flush();\n```\n\n## ArguslogClient API\n\n`new ArguslogClient(options, deps)` — no implicit globals; the client is a plain object.\n\n### Construction\n\n```ts\nnew ArguslogClient(options: ArguslogOptions, deps: ClientDeps)\n```\n\n`ArguslogOptions` (all optional except `dsn`):\n\n| Option           | Type                                              | Default  | Notes                                                                 |\n| ---------------- | ------------------------------------------------- | -------- | --------------------------------------------------------------------- |\n| `dsn`            | `string`                                          | required | `arguslog://<publicKey>@<host>/api/<projectId>`. Throws on malformed. |\n| `release`        | `string`                                          | none     | Free-form — git sha, semver, build number.                            |\n| `environment`    | `string`                                          | none     | E.g. `production`, `staging`, `dev`.                                  |\n| `sampleRate`     | `number` (0..1)                                   | `1.0`    | Fraction of events kept.                                              |\n| `maxBreadcrumbs` | `number`                                          | `50`     | Ring-buffer size for the default `GlobalScope`.                       |\n| `beforeSend`     | `(event) => event \\| null \\| Promise<...>`        | identity | Last-mile mutate / drop hook. Return `null` to suppress.              |\n| `scrubbing`      | `{ enabled?: boolean; extraPatterns?: RegExp[] }` | enabled  | PII redaction in messages and URLs.                                   |\n| `transport`      | `{ fetch?: typeof fetch; maxRetries?: number }`   | global   | Inject a custom fetch (testing) or bump retry budget.                 |\n| `integrations`   | `string[]`                                        | none     | Free-form tags consumed by platform packages, ignored by core.        |\n| `debug`          | `boolean`                                         | `false`  | Log every send to console — never enable in production.               |\n\n`ClientDeps`:\n\n| Field        | Type              | Notes                                                           |\n| ------------ | ----------------- | --------------------------------------------------------------- |\n| `adapter`    | `PlatformAdapter` | Names the SDK + enriches events with platform-only fields.      |\n| `parseStack` | `StackParser`     | Converts raw `Error.stack` into structured frames.              |\n| `scopeStore` | `ScopeStore?`     | Optional per-request scope. Defaults to a shared `GlobalScope`. |\n\n### Capture\n\n```ts\nclient.captureException(error, hint?): string  // returns event id\nclient.captureMessage(message, level?): string\nclient.addBreadcrumb({ category, message, level, data? })\n```\n\n`captureException` accepts non-`Error` values too — strings, plain objects, even symbols\nget wrapped synthetically so callers don't have to coerce upstream.\n\n### Scope mutation\n\n```ts\nclient.setUser({ id, email?, username? })\nclient.setTag('region', 'eu-west')\nclient.setContext('order', { id: 42, total_cents: 9900 })\n```\n\nThese mutate the underlying `ScopeStore`. With the default `GlobalScope` they're sticky\nfor the lifetime of the process — good enough for browsers and CLI tools. Server SDKs\nswap in a request-scoped store so concurrent requests don't bleed user contexts.\n\n### Lifecycle\n\n```ts\nawait client.flush();\n```\n\nDrains the in-flight send queue. Call before the process exits — short-lived scripts and\nserverless handlers will exit before the transport finishes its background sends\notherwise.\n\n### Underlying data flow\n\n```\ncaptureException / captureMessage\n  → scrubber                 (PII redaction)\n  → adapter.enrichEvent      (platform metadata)\n  → beforeSend               (caller hook)\n  → transport.send           (POST to ingestUrl, retry on 5xx with exponential backoff)\n```\n\nSample-rate is applied **before** scrubbing so the cost of redaction only hits events\nthat will actually ship.\n\n## DSN format\n\n```\narguslog://<publicKey>@<host>/api/<projectId>\n```\n\n`parseDsn(raw)` returns:\n\n```ts\n{\n  publicKey: string;\n  host: string;\n  protocol: 'http' | 'https'; // http only on localhost; https everywhere else\n  projectId: string;\n  ingestUrl: string; // fully resolved POST target\n}\n```\n\nMalformed input throws `InvalidDsnError`. The `publicKey` is project-scoped and safe to\nembed in public bundles.\n\n## Source\n\nThe full implementation lives in the [arguslog monorepo](https://github.com/petarnenov/arguslog)\nat `packages/sdk-core/`. Every platform package in that workspace is a worked example of\nhow to consume `sdk-core` cleanly. PRs welcome.\n","readmeFilename":"README.md"}