{"_id":"@apimom/client","name":"@apimom/client","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apimom/client","version":"0.1.0","description":"TypeScript client SDK for API Mom — unified egress for Cloudflare Workers","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./platform":{"import":"./dist/platform.js","types":"./dist/platform.d.ts"}},"scripts":{"build":"tsc","prepublishOnly":"npm run build"},"peerDependencies":{"@cloudflare/workers-types":">=4.0.0"},"devDependencies":{"@cloudflare/workers-types":"^4.20250327.0","typescript":"^5.7.0"},"keywords":["cloudflare","workers","api","sdk","egress"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/apimom/client.git"},"_id":"@apimom/client@0.1.0","gitHead":"f754658df2fbc3b4eafb03f995e00b1e075e93c5","bugs":{"url":"https://github.com/apimom/client/issues"},"homepage":"https://github.com/apimom/client#readme","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-DrKB8C+pUBLjFKeazhXPSfi4QzMMoct87DvfKN24VJX6pkVfhDN8dA03k82vyNUTjwqc5gdfTlL+WlcdX9byOQ==","shasum":"7b9b52e2aca54cc081a1a05ed16df48065895153","tarball":"https://registry.npmjs.org/@apimom/client/-/client-0.1.0.tgz","fileCount":11,"unpackedSize":34910,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEh6xXjgZwAMawtJEUCCu1XqzKzbSwuyd1zr68gAyugKAiEAmjlees2UcLnvSmflrImYBSPqDfDNCM3aShlf4VOvTkY="}]},"_npmUser":{"name":"apimom_admin","email":"admin@apimom.com"},"directories":{},"maintainers":[{"name":"apimom_admin","email":"admin@apimom.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/client_0.1.0_1776395273628_0.9435410087107909"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-17T03:07:53.493Z","0.1.0":"2026-04-17T03:07:53.789Z","modified":"2026-04-17T03:07:54.091Z"},"maintainers":[{"name":"apimom_admin","email":"admin@apimom.com"}],"description":"TypeScript client SDK for API Mom — unified egress for Cloudflare Workers","homepage":"https://github.com/apimom/client#readme","keywords":["cloudflare","workers","api","sdk","egress"],"repository":{"type":"git","url":"git+https://github.com/apimom/client.git"},"bugs":{"url":"https://github.com/apimom/client/issues"},"license":"MIT","readme":"# @apimom/client\n\nTypeScript client SDK for [API Mom](https://github.com/garywu/api-mom) — unified egress for Cloudflare Workers.\n\n## Install\n\n```bash\nnpm install @apimom/client\n```\n\n## Usage\n\n```typescript\nimport { createApiMom } from '@apimom/client';\n\nconst mom = createApiMom(env);\nconst child = mom.child('gemini', { function: 'generate' });\nconst result = await child.post('/gemini-2.0-flash:generateContent', { contents: [...] });\n```\n\n## Features\n\n- Chainable `.child(service, context)` scoping (like Pino logger)\n- Auto cost attribution via `X-Function` and `X-Tags` headers\n- Service binding support (Worker-to-Worker, avoids CF error 1042)\n- Budget checks and daily limit enforcement\n- D1 instrumentation and Analytics Engine metrics\n\n## Platform Utilities\n\n```typescript\nimport { checkBudget, instrumentD1, writeMetric } from '@apimom/client/platform';\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-5e74875caac562c46b40d90c06295ea2"}