{"_id":"@brutesoftware/loocat","name":"@brutesoftware/loocat","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@brutesoftware/loocat","version":"0.1.0","description":"The Loocat SDK — captures every error (and soon logs & traces) and ties each event to a tenant/account, so failures can be crossed with revenue.","license":"MIT","type":"module","sideEffects":false,"homepage":"https://github.com/Brute-Software/loocat/tree/main/packages/sdk#readme","repository":{"type":"git","url":"git+https://github.com/Brute-Software/loocat.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/Brute-Software/loocat/issues"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"unpkg":"./dist/loocat.min.js","jsdelivr":"./dist/loocat.min.js","publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","check-types":"tsc --noEmit","lint":"eslint src --max-warnings 0","test":"bun test","prepublishOnly":"tsup"},"keywords":["loocat","error-monitoring","observability","telemetry","apm","tracing","logging","sdk"],"engines":{"node":">=18"},"devDependencies":{"@loocat/eslint-config":"*","@loocat/typescript-config":"*","@types/bun":"^1.3.0","@types/node":"^22.15.30","eslint":"^9.39.1","tsup":"^8.5.0","typescript":"5.9.2"},"_id":"@brutesoftware/loocat@0.1.0","gitHead":"7112d2fe6c70cfcaa5becfbd6ca9d4ebb8963a07","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-SC+YIM6KXSEaloIyAYkUe2NplkpGsekv1HujxExamOf8r04fCSothXYna//EEJxZeebdpMZWbiLQIh3vPjbseQ==","shasum":"e0faf792514c0d2f191f410b2632d4888067a306","tarball":"https://registry.npmjs.org/@brutesoftware/loocat/-/loocat-0.1.0.tgz","fileCount":10,"unpackedSize":259255,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDJHOMkaYYr+iIk6D2kNB5vldhhE20DRZe84NW0BGL96wIgT8sBgkvpnqZbXDWqWeKboswFHpkp5YPbBEWyLPbF4jo="}]},"_npmUser":{"name":"brutesoftware","email":"contatobrutesoftware@gmail.com"},"directories":{},"maintainers":[{"name":"brutesoftware","email":"contatobrutesoftware@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/loocat_0.1.0_1782917303628_0.25985429637405555"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T14:48:23.434Z","0.1.0":"2026-07-01T14:48:23.757Z","modified":"2026-07-01T14:48:24.024Z"},"maintainers":[{"name":"brutesoftware","email":"contatobrutesoftware@gmail.com"}],"description":"The Loocat SDK — captures every error (and soon logs & traces) and ties each event to a tenant/account, so failures can be crossed with revenue.","homepage":"https://github.com/Brute-Software/loocat/tree/main/packages/sdk#readme","keywords":["loocat","error-monitoring","observability","telemetry","apm","tracing","logging","sdk"],"repository":{"type":"git","url":"git+https://github.com/Brute-Software/loocat.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/Brute-Software/loocat/issues"},"license":"MIT","readme":"# @brutesoftware/loocat\n\nThe Loocat SDK. Captures every error the moment it happens — with stack trace,\nthe user who got stuck, and the **tenant** it belongs to — and ships it to Loocat\nso each failure can be crossed with revenue.\n\nErrors ship today. The event pipeline is already shaped for **logs** and\n**traces** (`kind: \"error\" | \"log\" | \"span\"`), so those flow through the same\ntransport when they land.\n\n## Install\n\n```bash\nnpm install @brutesoftware/loocat\n# or: bun add @brutesoftware/loocat\n```\n\n## Quick start\n\n```ts\nimport { Loocat } from \"@brutesoftware/loocat\";\n\nconst loocat = new Loocat({\n  apiKey: process.env.LOOCAT_KEY!,\n  tenant: account.id, // ties every event to an account — this is the differentiator\n});\n\n// Global error/rejection handlers auto-install in the browser.\n// Capture manually anywhere:\nloocat.captureException(err, { user: { id: user.id }, tags: { flow: \"checkout\" } });\n```\n\nOr use the global singleton:\n\n```ts\nimport { init, captureException, setTenant } from \"@brutesoftware/loocat\";\n\ninit({ apiKey: process.env.LOOCAT_KEY! });\nsetTenant(account.id);\ncaptureException(err);\n```\n\n### Browser via `<script>`\n\n```html\n<script src=\"https://unpkg.com/@brutesoftware/loocat\"></script>\n<script>\n  Loocat.init({ apiKey: \"pk_live_xxx\", tenant: \"acme\" });\n</script>\n```\n\n## API\n\n| Method | What it does |\n| --- | --- |\n| `new Loocat(options)` | Create a client (auto-instruments the browser). |\n| `captureException(error, context?)` | Send an exception. Returns the event id. |\n| `captureMessage(message, level?, context?)` | Send a standalone message (`log` event). |\n| `setUser(user \\| null)` | Identify the impacted user. Preserved through PII scrubbing. |\n| `setTenant(tenant \\| null)` | Re-point capture at another account. |\n| `setTag(key, value)` / `setContext(key, data)` | Attach structured metadata. |\n| `addBreadcrumb(crumb)` | Record a trail leading up to errors. |\n| `flush(timeout?)` | Force-send buffered events. |\n| `close(timeout?)` | Flush, uninstall handlers, stop. |\n\n## Options\n\n| Option | Default | Notes |\n| --- | --- | --- |\n| `apiKey` | — | **Required.** Public ingest key. |\n| `tenant` | — | Account each event belongs to. |\n| `environment` | `NODE_ENV` or `\"production\"` | Deployment environment. |\n| `release` | — | Version identifier for grouping regressions. |\n| `endpoint` | `https://ingest.loocat.io/v1/events` | Ingest URL. |\n| `sampleRate` | `1` | 0..1. Loocat keeps 100% by default — no sampling. |\n| `maxBatchSize` | `20` | Events per flush. |\n| `flushInterval` | `5000` | Flush cadence (ms). |\n| `maxBreadcrumbs` | `30` | Breadcrumbs retained per event. |\n| `maxQueueSize` | `100` | Buffer cap while offline (drops oldest). |\n| `autoInstrument` | `true` in browser, `false` in Node | Install global handlers. |\n| `scrubPii` | `true` | Mask emails / redact secret-looking keys. |\n| `beforeSend` | — | Mutate or drop each event (`return null` to drop). |\n| `debug` | `false` | Print internal diagnostics. |\n\n## Design notes\n\n- **Never breaks the host app.** Every public method is wrapped; a bug in the SDK\n  can't throw into your code.\n- **Pipeline:** enrich → scrub (PII) → sample → `beforeSend` → batched transport.\n- **Transport:** batches events, flushes on a timer / when a batch fills / on page\n  unload (`sendBeacon`), retries retryable failures (5xx, 429, network) with\n  exponential backoff, and caps the offline buffer.\n- **Isomorphic:** one build works in the browser and Node ≥18 (global `fetch`).\n\n## Development\n\n```bash\nbun install\nbun run build        # tsup → ESM + CJS + .d.ts + minified IIFE\nbun test\nbun run check-types\n```\n\n## Releasing\n\nPublishing is automated. Bump the version in `package.json`, then push a\nmatching tag:\n\n```bash\ngit tag loocat-sdk-v0.1.0\ngit push origin loocat-sdk-v0.1.0\n```\n\nThe `Publish @brutesoftware/loocat to npm` GitHub Actions workflow builds the package and runs\n`npm publish --access public`. It requires an `NPM_TOKEN` repo secret (an npm\nautomation token with publish rights to the `@brutesoftware` scope). The tag\nversion must match `package.json`, or the workflow fails before publishing.\n\n> Provenance (`--provenance`) is omitted because it requires a public source\n> repository. If this repo becomes public, re-add `--provenance` and the\n> `id-token: write` permission to the workflow.\n","readmeFilename":"README.md","_rev":"1-372094258d6948fd8431d986ef89d4e7"}