{"_id":"@autopilotstartup/log-sdk","_rev":"3-c1dfd0d0e73d815db73d6c075c5cc32d","name":"@autopilotstartup/log-sdk","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@autopilotstartup/log-sdk","version":"0.1.0","_id":"@autopilotstartup/log-sdk@0.1.0","maintainers":[{"name":"autopilotstartup","email":"nla@autopilotstartup.com"}],"dist":{"shasum":"70e1195ebe7a9f5c1dbc9ccb4e04b98f01d4397c","tarball":"https://registry.npmjs.org/@autopilotstartup/log-sdk/-/log-sdk-0.1.0.tgz","fileCount":26,"integrity":"sha512-Oks6Nb7lmeTDc4YzPL99OHfdoCZ0ZIruAwDguG2QopilctfsAQFrruUTuytPrA7cl4MfPgAqGaHosH+nEeCt+w==","signatures":[{"sig":"MEUCIQCMrbM/GMzJel4kP+62eWnlDfYH0rlTfSxGG0TfJLYNIQIgMTgamnzwugTza7NewcltMA1FUt3OIbzxZdDdjMlPKB0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":244937},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"./react-native":{"types":"./dist/react-native.d.ts","import":"./dist/react-native.js","require":"./dist/react-native.cjs"}},"gitHead":"c1848e83e826e7207b9ba78e65b85a9a3b1623b9","scripts":{"test":"vitest run","build":"tsup","check":"tsc --noEmit","prepack":"npm run check && npm run test && npm run build"},"_npmUser":{"name":"autopilotstartup","email":"nla@autopilotstartup.com"},"_npmVersion":"11.13.0","description":"Cross-runtime TypeScript SDK for Autopilot Log Server","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.9","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/log-sdk_0.1.0_1786333302545_0.20175323204326157","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@autopilotstartup/log-sdk","version":"0.2.0","_id":"@autopilotstartup/log-sdk@0.2.0","maintainers":[{"name":"autopilotstartup","email":"nla@autopilotstartup.com"}],"dist":{"shasum":"ac5980492cde2838be5403aa3bd8e9826ac18e2b","tarball":"https://registry.npmjs.org/@autopilotstartup/log-sdk/-/log-sdk-0.2.0.tgz","fileCount":28,"integrity":"sha512-RuPxtOvFZvRQsTIyVhv9Fguglu1LOGg1IRDmee51lktmt5jjPPNGsOIZZkSBy2PH6oTAnsaQw+SG8eq13tr9eQ==","signatures":[{"sig":"MEUCIEHkSZIma2UOPWrCxIUFi2UkjDcxy3lR2jVRP5cchBsPAiEAjbBJmF6qNQcg2sob9Su5aSDjVcdVCPGxe5VKkp1orgk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":305005},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"./react-native":{"types":"./dist/react-native.d.ts","import":"./dist/react-native.js","require":"./dist/react-native.cjs"}},"gitHead":"c1848e83e826e7207b9ba78e65b85a9a3b1623b9","scripts":{"test":"vitest run","build":"tsup","check":"tsc --noEmit","prepack":"npm run check && npm run test && npm run build"},"_npmUser":{"name":"autopilotstartup","email":"nla@autopilotstartup.com"},"_npmVersion":"11.13.0","description":"Cross-runtime TypeScript SDK for Autopilot Log Server","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.1.9","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/log-sdk_0.2.0_1786334162290_0.7729939001149893","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@autopilotstartup/log-sdk","version":"0.3.0","description":"Cross-runtime TypeScript SDK for Autopilot Log Server","type":"module","sideEffects":false,"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"},"./browser":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"./react-native":{"types":"./dist/react-native.d.ts","import":"./dist/react-native.js","require":"./dist/react-native.cjs"},"./node":{"types":"./dist/node.d.ts","import":"./dist/node.js","require":"./dist/node.cjs"}},"scripts":{"build":"tsup","check":"tsc --noEmit","test":"vitest run","prepack":"npm run check && npm run test && npm run build"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.5.0","typescript":"^6.0.3","vitest":"^4.1.9"},"engines":{"node":">=18"},"gitHead":"c1848e83e826e7207b9ba78e65b85a9a3b1623b9","_id":"@autopilotstartup/log-sdk@0.3.0","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-4m4DnH6d9faCmgL0Q1Qgjl37aZ5oXgMgCXArDMSkPwrqRd833VJfi+DiI4kYusCDr/Jbp5Yod+cMG1w1DXAlYA==","shasum":"f4f4b1c0b5e441616dc9bd0e4259ea3ee455872f","tarball":"https://registry.npmjs.org/@autopilotstartup/log-sdk/-/log-sdk-0.3.0.tgz","fileCount":28,"unpackedSize":309444,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHx3mTOIm8Xlgj8oFLjrajWSjvwjxPvr3BpwAf3LPoMmAiBGem6GxzvQOhLI8wGJBcwDml9n0UWz1qoSb25ehuRiSw=="}]},"_npmUser":{"name":"autopilotstartup","email":"nla@autopilotstartup.com"},"directories":{},"maintainers":[{"name":"autopilotstartup","email":"nla@autopilotstartup.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/log-sdk_0.3.0_1786336851227_0.6517138492216397"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-10T03:41:42.369Z","modified":"2026-08-10T04:40:51.497Z","0.1.0":"2026-08-10T03:41:42.695Z","0.2.0":"2026-08-10T03:56:02.426Z","0.3.0":"2026-08-10T04:40:51.365Z"},"description":"Cross-runtime TypeScript SDK for Autopilot Log Server","maintainers":[{"name":"autopilotstartup","email":"nla@autopilotstartup.com"}],"readme":"# `@autopilotstartup/log-sdk`\n\nCross-runtime TypeScript client for an Autopilot Log Server deployment. The\npackage has no runtime dependencies and provides target-specific entry points\nwithout duplicating the logging protocol.\n\n## Install\n\n```bash\nnpm install @autopilotstartup/log-sdk\n```\n\n## Browser or React Native\n\nClient loggers use the restricted `/client-logs` endpoint and expose only\n`warn` and `error`. The application must be registered by the Log Server.\n\n```ts\nimport { createClientLogger } from '@autopilotstartup/log-sdk/browser'\n\nconst logger = createClientLogger({\n  applicationId: 'my-web-app',\n  apiKey: process.env.PUBLIC_LOG_INGESTION_KEY!,\n  environment: 'production',\n})\n\nlogger.warn('Search results are stale', { operation: 'search' })\nlogger.error('Checkout failed', new Error('Gateway unavailable'))\nawait logger.flush()\n```\n\nUse `@autopilotstartup/log-sdk/react-native` for React Native. Pass a custom `fetch`\nimplementation only in runtimes that do not provide the Fetch API.\n\nClient ingestion keys identify an application but cannot be confidential when\nembedded in distributed software. Log Server must enforce client validation,\nsanitization, and rate limits.\n\n## Node\n\nBackend loggers use the privileged `/logs` endpoint and additionally expose\n`info` and `child`.\n\n```ts\nimport { createBackendLogger } from '@autopilotstartup/log-sdk/node'\n\nconst logger = createBackendLogger({\n  applicationId: 'my-api',\n  apiKey: process.env.LOG_APP_SECRET!,\n  environment: process.env.NODE_ENV,\n})\n\nconst requestLogger = logger.child({ requestId: 'req_123' })\nrequestLogger.info('Request started', { route: '/v1/orders' })\nrequestLogger.error('Request failed', new Error('Database unavailable'))\nawait logger.close()\n```\n\nThe SDK keeps a bounded in-memory queue, batches requests, redacts common\nsensitive fields, times out requests, and requeues failed batches. It does not\npersist queued events across process or app restarts.\n\n### Durable Node transports\n\nApplications that already own a disk spool can use `sendLogBatch` from the Node\nentry point. It sends prebuilt events without changing IDs, timestamps, or\nmetadata, and exposes HTTP status and `Retry-After` through `LogTransportError`.\nThe application remains responsible for persistence, ordering, and retry policy.\n\n## Configuration\n\nRequired options are `applicationId` and `apiKey`. The SDK owns the official\nLog Server endpoint and defaults `service` to `applicationId`. Optional\n`endpoint` and `service` overrides support local development, self-hosting, and\nmulti-service applications. Other controls include `environment`, `batchSize`, `maxQueueSize`,\n`flushIntervalMs`, `requestTimeoutMs`, `fetch`, `generateEventId`, and `now`.\n\nCall `close()` during graceful Node shutdown. Browser and mobile telemetry is\nbest-effort; call `flush()` at an appropriate lifecycle boundary when possible.\n","readmeFilename":"README.md"}