{"_id":"@anyhook/core","_rev":"3-a40699c0fd98f051f4d6c2ee1013ae2f","name":"@anyhook/core","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@anyhook/core","version":"0.2.0","keywords":["webhooks","outbound","standard-webhooks","retry","circuit-breaker","edge","serverless"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/core@0.2.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"3e5772d024fd086e6f5a781307fc3330a2e41bbe","tarball":"https://registry.npmjs.org/@anyhook/core/-/core-0.2.0.tgz","fileCount":49,"integrity":"sha512-mZgXYufKbTofQV0zjbtX0LLAZDeA8ALm5G1oj7bkww6p7NO0Pj33oY7Ikzxb+TSBD6Wl1wQuF0tevkaY3tgsBg==","signatures":[{"sig":"MEUCIFjT9bhFeqFmOwR+/RtaEaXq6XMJNJTX3PHuY6HK282bAiEAnVE9ICaOPnVMsgSly3Bgt87ccyWQBp8309tTObPEsK8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71931},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./ports":{"types":"./dist/ports/index.d.ts","import":"./dist/ports/index.js"},"./policy":{"types":"./dist/policy/index.d.ts","import":"./dist/policy/index.js"},"./portal":{"types":"./dist/portal/index.d.ts","import":"./dist/portal/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"Runtime-agnostic outbound webhook delivery engine: ports, types, retry/circuit state machine, fan-out, portal handlers","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0","@anyhook/signing":"workspace:*","@anyhook/testing":"workspace:*","standardwebhooks":"^1.0.0"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.0_1784916189099_0.5657208025036571","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@anyhook/core","version":"0.2.1","keywords":["webhooks","outbound","standard-webhooks","retry","circuit-breaker","edge","serverless"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/core@0.2.1","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"f7a99a23caf3a4df42e60f0663062beaa6f2275b","tarball":"https://registry.npmjs.org/@anyhook/core/-/core-0.2.1.tgz","fileCount":49,"integrity":"sha512-pz8qcoCf+vS0qsntTI0/ywcGEPtKUVZWlPaop40zeyfj5Xdbh8TbLQAQs1DfXVxj8kZFTk4PuMOkFRiLsZSMgQ==","signatures":[{"sig":"MEUCIQCMZFC3I2fnn7SI7/6EXKceCF098Soh9nqIXm/tS3eX2QIgbjX5dkPNgBmsZH0Xou0VoayMIah07qL51Mzl70t+fEo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71919},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./ports":{"types":"./dist/ports/index.d.ts","import":"./dist/ports/index.js"},"./policy":{"types":"./dist/policy/index.d.ts","import":"./dist/policy/index.js"},"./portal":{"types":"./dist/portal/index.d.ts","import":"./dist/portal/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","clean":"rm -rf dist coverage","typecheck":"tsc --noEmit","test:watch":"bun test --watch","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"Runtime-agnostic outbound webhook delivery engine: ports, types, retry/circuit state machine, fan-out, portal handlers","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0","@anyhook/signing":"0.2.1","@anyhook/testing":"0.2.1","standardwebhooks":"^1.0.0"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.1_1784916760527_0.5107912964829371","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@anyhook/core","version":"0.2.2","description":"Runtime-agnostic outbound webhook delivery engine: ports, types, retry/circuit state machine, fan-out, portal handlers","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./ports":{"import":"./dist/ports/index.js","types":"./dist/ports/index.d.ts"},"./policy":{"import":"./dist/policy/index.js","types":"./dist/policy/index.d.ts"},"./portal":{"import":"./dist/portal/index.js","types":"./dist/portal/index.d.ts"}},"scripts":{"build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","build:types":"tsc --emitDeclarationOnly --outDir dist","dev":"bun build ./src/index.ts --outdir ./dist --target bun --watch","test":"bun test","test:watch":"bun test --watch","typecheck":"tsc --noEmit","clean":"rm -rf dist coverage"},"peerDependencies":{"typescript":"^5.0.0"},"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0","@anyhook/signing":"0.2.2","@anyhook/testing":"0.2.2","standardwebhooks":"^1.0.0"},"keywords":["webhooks","outbound","standard-webhooks","retry","circuit-breaker","edge","serverless"],"license":"MIT","author":"Shantanu Sharma","publishConfig":{"access":"public"},"_id":"@anyhook/core@0.2.2","_integrity":"sha512-jTu5JVc2mbOMcfnYF51I4uN+ZwqY992izi7SW+ef15TRvxC+vo4Ea1Z5KQUOJcfnk4tW4KEAVAYAXn2VqL5j6Q==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"daafee3e085b5e4cf3ac136b4acee411c1e6d2ca","dist":{"integrity":"sha512-jTu5JVc2mbOMcfnYF51I4uN+ZwqY992izi7SW+ef15TRvxC+vo4Ea1Z5KQUOJcfnk4tW4KEAVAYAXn2VqL5j6Q==","shasum":"daafee3e085b5e4cf3ac136b4acee411c1e6d2ca","tarball":"https://registry.npmjs.org/@anyhook/core/-/core-0.2.2.tgz","fileCount":49,"unpackedSize":71796,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCiPKJXnaMU9mVBBfBZMi2zY1vPhoLjFwGUeYl9SwkrpAIgfCiVDthkvWKbqNptMQwfbGY4vGtd9Iwp2NCuONbkNHc="}]},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"directories":{},"maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.2.2_1788790447900_0.8753535894383366"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T18:03:08.950Z","modified":"2026-09-07T14:14:08.326Z","0.2.0":"2026-07-24T18:03:09.252Z","0.2.1":"2026-07-24T18:12:40.654Z","0.2.2":"2026-09-07T14:14:08.047Z"},"author":"Shantanu Sharma","license":"MIT","keywords":["webhooks","outbound","standard-webhooks","retry","circuit-breaker","edge","serverless"],"description":"Runtime-agnostic outbound webhook delivery engine: ports, types, retry/circuit state machine, fan-out, portal handlers","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"readme":"# @anyhook/core\n\nThe runtime-agnostic heart of [anyhook](https://github.com/sns45/anyhook): the outbound webhook delivery engine. Defines the ports that adapters implement and owns all webhook-specific logic — fan-out, Standard Webhooks signing hooks, the retry/backoff + circuit-breaker + DLQ state machine, the delivery log, and the portal HTTP router.\n\n**Zero runtime-SDK dependencies.** Core defines interfaces; `@anyhook/cloudflare` / `@anyhook/aws` implement them. This is what makes the engine portable.\n\n## Install\n\n```bash\nnpm i @anyhook/core\n```\n\n## Overview\n\n- **Ports** (`Transport`, `StateStore`, `Scheduler`, `HttpClient`, `WebhookSigner`, `UrlPolicy`, `Clock`, `Rng`) — injected by an adapter.\n- **`WebhookEngine`** — `send()` (async acceptance, never blocks on delivery) + `processMessage()` (deliver → classify → retry/DLQ/circuit).\n- **Policy** — backoff schedule with full jitter, outcome classification, circuit-breaker state machine.\n- **Portal** — endpoint CRUD + delivery-log/replay handlers and a framework-agnostic `createPortalRouter`.\n- **Security** — SSRF-safe `defaultUrlPolicy` (blocks private/loopback/link-local + obfuscated-IP targets).\n\n```ts\nimport { WebhookEngine, createPortalRouter } from '@anyhook/core';\n\nconst engine = new WebhookEngine({ transport, state, scheduler, http, signer });\nconst receipt = await engine.send({ type: 'payment.succeeded', tenant: 'acme', payload });\n```\n\nWire it to a runtime with `@anyhook/cloudflare` or `@anyhook/aws`. MIT.\n","readmeFilename":"README.md"}