{"_id":"@coglet/logsafe-client","_rev":"2-63a415d4b8137cfb0af9f3e7cbfba530","name":"@coglet/logsafe-client","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@coglet/logsafe-client","version":"0.2.0","keywords":["logging","logsafe","debugging"],"license":"MIT","_id":"@coglet/logsafe-client@0.2.0","maintainers":[{"name":"omarqx","email":"omarqaddoumi@gmail.com"}],"homepage":"https://github.com/omarqx/logsafe#readme","bugs":{"url":"https://github.com/omarqx/logsafe/issues"},"dist":{"shasum":"5f0484de21f68a74fc1a204b00d32d63fc07d986","tarball":"https://registry.npmjs.org/@coglet/logsafe-client/-/logsafe-client-0.2.0.tgz","fileCount":5,"integrity":"sha512-gDqqOCWoPZnNvbtmYRsIb0FLE990f4wm8yY/zvc8si+C8/o/MIUfEd0IvSgG0cm0ic6lMQ1/kLdKmJ8MPl0U4A==","signatures":[{"sig":"MEUCIQDEthdiHQMB3UBSPRDgE8CoQIHhR1wdr2WBdvcwK7gkfgIgaMTWDpmIiWvqOFVtisfoT+fMAzpBtIej4BDpHGZh94E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10488},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"36885176c7985276116f4e0103a6d848370cb39a","scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"tsc -p tsconfig.json && npx vitest run --root ../.. packages/client"},"_npmUser":{"name":"omarqx","email":"omarqaddoumi@gmail.com"},"repository":{"url":"git+https://github.com/omarqx/logsafe.git","type":"git","directory":"packages/client"},"_npmVersion":"11.11.0","description":"Zero-dependency logging client for logsafe: batched HTTP delivery, sendBeacon unload flush, never throws into the host app.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/logsafe-client_0.2.0_1784080309483_0.8644388857096148","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@coglet/logsafe-client","version":"0.3.0","description":"Zero-dependency logging client for logsafe: batched HTTP delivery, sendBeacon unload flush, never throws into the host app.","keywords":["logging","logsafe","debugging"],"license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"sideEffects":false,"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/omarqx/logsafe.git","directory":"packages/client"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"tsc -p tsconfig.json && npx vitest run --root ../.. packages/client"},"gitHead":"8a92c640d0b0a1883db79270eb64ad5b9f273154","_id":"@coglet/logsafe-client@0.3.0","bugs":{"url":"https://github.com/omarqx/logsafe/issues"},"homepage":"https://github.com/omarqx/logsafe#readme","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-iP77Hmi5B9X42uU31tmCQDwOzALQHR6gzhS6g0rham7c1SBR7TlYaJwBR38sjbkcOfqaf1LL2+i1r23AbniLxQ==","shasum":"192af8b58c2785bfe291d5ea47c27f0e2080312a","tarball":"https://registry.npmjs.org/@coglet/logsafe-client/-/logsafe-client-0.3.0.tgz","fileCount":5,"unpackedSize":10524,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA5VndJ+7brtGQjMIs8JAI0leBMdSnQ3/H5TI7K+jwfOAiEAiIhudBnx/iUCBSBNCyPsGrFTTaLBkV0Cnquei6JbcWY="}]},"_npmUser":{"name":"omarqx","email":"omarqaddoumi@gmail.com"},"directories":{},"maintainers":[{"name":"omarqx","email":"omarqaddoumi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/logsafe-client_0.3.0_1784255768120_0.9873221321671835"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T01:51:49.268Z","modified":"2026-07-17T02:36:08.415Z","0.2.0":"2026-07-15T01:51:49.627Z","0.3.0":"2026-07-17T02:36:08.254Z"},"bugs":{"url":"https://github.com/omarqx/logsafe/issues"},"license":"MIT","homepage":"https://github.com/omarqx/logsafe#readme","keywords":["logging","logsafe","debugging"],"repository":{"type":"git","url":"git+https://github.com/omarqx/logsafe.git","directory":"packages/client"},"description":"Zero-dependency logging client for logsafe: batched HTTP delivery, sendBeacon unload flush, never throws into the host app.","maintainers":[{"name":"omarqx","email":"omarqaddoumi@gmail.com"}],"readme":"# @coglet/logsafe-client\n\nZero-dependency logging client for [logsafe](https://github.com/omarqx/logsafe):\nbatched HTTP delivery, `sendBeacon` unload flush, never throws into the host\napp.\n\n## Install\n\n```bash\nnpm i @coglet/logsafe-client\n```\n\n## Usage\n\n```ts\nimport { initLogsafe, createLog } from '@coglet/logsafe-client'\n\nconst { sessionId } = initLogsafe({\n  source: 'webapp',              // required: identifies this process/app\n  sessionLabel: 'checkout flow', // optional, human-readable\n  // url: 'http://127.0.0.1:4600' (default)\n})\n\nconst log = createLog('cart')    // ns: a dotted/colon namespace for this logger\nlog.info('cart hydrated', { items: 3, total_cents: 8497 })\nlog.error('payment failed', { status: 502 })\n\n// Follow one request/operation across sources by sharing a trace id:\nconst reqLog = createLog('cart:payment').withTrace(`req-${sessionId.slice(0, 6)}`)\nreqLog.info('submitting payment', { provider: 'stripe' })\n```\n\nEvents are buffered and flushed automatically (every 250ms, or immediately\nat 64 buffered events), and flushed on page unload via `sendBeacon`. Call\n`flush()` to force-send (useful before a script exits, e.g. in tests or a\nCLI tool).\n\n## Server\n\nThis client needs a logsafe server to send events to. The server is the\n`logsafe` package:\n\n```bash\nnpx @coglet/logsafe\n```\n\n## Docs\n\nFull docs, including the frozen HTTP contract (`API.md`), are at\nhttps://github.com/omarqx/logsafe.\n","readmeFilename":"README.md"}