{"_id":"@api-graveyard/node","name":"@api-graveyard/node","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@api-graveyard/node","version":"0.1.0","description":"Official Node.js collector for API Graveyard — automatically tracks your outgoing HTTP dependencies","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build","test":"jest","lint":"tsc --noEmit"},"keywords":["api","monitoring","dependency","tracking","http","observability"],"author":{"name":"API Graveyard"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Shakargy/api-graveyard-node.git"},"homepage":"https://api-graveyard.com","devDependencies":{"@types/node":"^20.0.0","typescript":"^5.4.0","jest":"^29.0.0","@types/jest":"^29.0.0","ts-jest":"^29.0.0"},"engines":{"node":">=16.0.0"},"_id":"@api-graveyard/node@0.1.0","gitHead":"3af270743381d3ea4ca12da6ebee23b7e33f6c51","bugs":{"url":"https://github.com/Shakargy/api-graveyard-node/issues"},"_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-hUYI+411JenEZrEt8RSCD8/fMsg1wY3ikBW9ZPfmELefoJZm1oJwsdpZ989EP8Hn4i4bVmFm/vCW1geol9LsPA==","shasum":"df0c1555882f889c92892b5c0a2e038a32aa796c","tarball":"https://registry.npmjs.org/@api-graveyard/node/-/node-0.1.0.tgz","fileCount":18,"unpackedSize":29453,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBc3j1gNqADkT7r7YfnHkGK6zHKwYFwKW5uyaKFH4kkEAiBO2i385VyyRa1gQm65KS08H5yI+qxjcpkesKX4gMl+kQ=="}]},"_npmUser":{"name":"api-graveyard","email":"hello@api-graveyard.com"},"directories":{},"maintainers":[{"name":"api-graveyard","email":"hello@api-graveyard.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node_0.1.0_1777890178456_0.27836063209287465"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T10:22:58.381Z","0.1.0":"2026-05-04T10:22:58.610Z","modified":"2026-05-04T10:22:58.780Z"},"maintainers":[{"name":"api-graveyard","email":"hello@api-graveyard.com"}],"description":"Official Node.js collector for API Graveyard — automatically tracks your outgoing HTTP dependencies","homepage":"https://api-graveyard.com","keywords":["api","monitoring","dependency","tracking","http","observability"],"repository":{"type":"git","url":"git+https://github.com/Shakargy/api-graveyard-node.git"},"author":{"name":"API Graveyard"},"bugs":{"url":"https://github.com/Shakargy/api-graveyard-node/issues"},"license":"MIT","readme":"# api-graveyard\n\nOfficial Node.js collector for [API Graveyard](https://api-graveyard.com) — automatically tracks your outgoing HTTP dependencies, detects risk events, and surfaces zombie APIs before they take down your product.\n\n## Install\n\n```bash\nnpm install @api-graveyard/node\n```\n\n## Quick start\n\nAdd one line to the top of your app entry point:\n\n```js\nconst apiGraveyard = require('@api-graveyard/node');\n\napiGraveyard.init({\n  apiKey: 'agk_your_key_here',\n  projectId: 'your-project-id',\n});\n\n// ... rest of your app\n```\n\nThat's it. Every outgoing HTTP/HTTPS request your app makes is now automatically captured, batched, and sent to API Graveyard in the background.\n\n## TypeScript\n\n```ts\nimport { init } from '@api-graveyard/node';\n\ninit({\n  apiKey: process.env.API_GRAVEYARD_KEY!,\n  projectId: process.env.API_GRAVEYARD_PROJECT_ID!,\n  serviceName: 'my-backend',\n  environment: process.env.NODE_ENV,\n});\n```\n\n## Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | **required** | Your `agk_...` API key from the dashboard |\n| `projectId` | `string` | **required** | Your project ID from the dashboard |\n| `baseUrl` | `string` | `https://api-graveyard.com` | Override for self-hosted |\n| `serviceName` | `string` | `undefined` | Tag events with a service name |\n| `environment` | `string` | `process.env.NODE_ENV` | Tag events with an environment |\n| `flushIntervalMs` | `number` | `10000` | How often to flush the event buffer (ms) |\n| `maxBatchSize` | `number` | `100` | Max events per batch before forcing a flush |\n| `debug` | `boolean` | `false` | Log flush activity to console |\n\n## Express middleware\n\nIf you only want to capture inbound requests to your own Express server (not outgoing calls):\n\n```js\nconst { middleware } = require('@api-graveyard/node');\n\napp.use(middleware({\n  apiKey: 'agk_your_key_here',\n  projectId: 'your-project-id',\n  serviceName: 'my-api',\n}));\n```\n\n## Graceful shutdown\n\nThe collector automatically flushes on `SIGTERM` and `beforeExit`. For manual control:\n\n```js\nprocess.on('SIGINT', async () => {\n  await apiGraveyard.shutdown();\n  process.exit(0);\n});\n```\n\n## What gets captured\n\n- Method, URL, HTTP status code, response time\n- Timestamp of each request\n- Service name and environment (if configured)\n\nRequests to `api-graveyard.com` itself are never captured to avoid infinite loops.\nLocalhost and `127.0.0.1` requests are ignored by default.\n\n## Get your API key\n\n1. Sign up at [api-graveyard.com](https://api-graveyard.com)\n2. Create a project\n3. Go to **Settings → Integrations** and create an API key\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-5a42d659972415239102572723232b88"}