{"_id":"@anyhook/signing","_rev":"3-d1fc1bf7e5b7a547cc2a401c7fb53ea9","name":"@anyhook/signing","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@anyhook/signing","version":"0.2.0","keywords":["webhooks","standard-webhooks","hmac","signing"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/signing@0.2.0","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"63a30672793f27430062e6c2564539810987a7f1","tarball":"https://registry.npmjs.org/@anyhook/signing/-/signing-0.2.0.tgz","fileCount":11,"integrity":"sha512-wSw/JplfCcJorsjtpHbN7w4w+Lfy+kRIXfTbxfEOg/tI+OGuQZjRTKGdsSZOx1sEpMH47Glfn2jdkTeW5M3ZvA==","signatures":[{"sig":"MEUCIBLAQ2s7OEl1CLXs3MvfSAiujfALsIR35t6eIMm34S4SAiEArQpxUpMxNwmowSI7AwbR6v2LgFReFN7Er491ODCazU0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10451},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"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","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"Standard Webhooks sign/verify primitives for anyhook","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0","standardwebhooks":"1.0.0"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/signing_0.2.0_1784916030197_0.35446315831948727","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@anyhook/signing","version":"0.2.1","keywords":["webhooks","standard-webhooks","hmac","signing"],"author":{"name":"Shantanu Sharma"},"license":"MIT","_id":"@anyhook/signing@0.2.1","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"dist":{"shasum":"59824303c840698f9f546a04c2c1bbe270f01cfa","tarball":"https://registry.npmjs.org/@anyhook/signing/-/signing-0.2.1.tgz","fileCount":11,"integrity":"sha512-jjikdM1H8yID4lmvofjI85eD1u5fxRn+IoblpV4vYr5AhmHfT8+owjG1VEjnrqzpgYXXW0eCjl1u3ijHH9tZJA==","signatures":[{"sig":"MEQCIBS0Lx7LK09NxC7Un7QrbFpteMErDg+dhR3ubE4+UlvJAiB8HTGYiaX/3O9wRW5WuGhZeYSgh3KG55UAwdKScsQkPA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10451},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b52f20c74ba626bcc43682bc8e746a9ca4b40b69","scripts":{"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","build:types":"tsc --emitDeclarationOnly --outDir dist"},"_npmUser":{"name":"sns45","email":"notifyshantanu@gmail.com"},"_npmVersion":"10.9.2","description":"Standard Webhooks sign/verify primitives for anyhook","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.1.0","typescript":"^5.3.0","standardwebhooks":"1.0.0"},"peerDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/signing_0.2.1_1784916756877_0.2996295600544203","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@anyhook/signing","version":"0.2.2","description":"Standard Webhooks sign/verify primitives for anyhook","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"bun build ./src/index.ts --outdir ./dist --target bun && bun run build:types","build:types":"tsc --emitDeclarationOnly --outDir dist","test":"bun test","typecheck":"tsc --noEmit","clean":"rm -rf dist coverage"},"peerDependencies":{"typescript":"^5.0.0"},"devDependencies":{"@types/bun":"^1.1.0","standardwebhooks":"1.0.0","typescript":"^5.3.0"},"keywords":["webhooks","standard-webhooks","hmac","signing"],"license":"MIT","author":"Shantanu Sharma","publishConfig":{"access":"public"},"_id":"@anyhook/signing@0.2.2","_integrity":"sha512-sVps0wCKMoaVBA6lfRi9aTIF5DFekddwV7oHGHDTC/Z8ySp3TX+QDvZKjgL+x7xrCJzFvMNlOhdRuDnp7G+aCQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"776189425af05b9f3c65cd0b2b087417c298afc6","dist":{"integrity":"sha512-sVps0wCKMoaVBA6lfRi9aTIF5DFekddwV7oHGHDTC/Z8ySp3TX+QDvZKjgL+x7xrCJzFvMNlOhdRuDnp7G+aCQ==","shasum":"776189425af05b9f3c65cd0b2b087417c298afc6","tarball":"https://registry.npmjs.org/@anyhook/signing/-/signing-0.2.2.tgz","fileCount":11,"unpackedSize":10451,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAN9AoQ3zCDDwbgFKa0QISAqHQN5sjKGB1f43pnwDF7PAiEAgeSIiErRXfce1Ow4RZvVeaED1gROtssyvAHYmS3rf9g="}]},"_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/signing_0.2.2_1788790445989_0.14405059185587277"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T18:00:30.002Z","modified":"2026-09-07T14:14:06.469Z","0.2.0":"2026-07-24T18:00:30.340Z","0.2.1":"2026-07-24T18:12:37.075Z","0.2.2":"2026-09-07T14:14:06.103Z"},"author":"Shantanu Sharma","license":"MIT","keywords":["webhooks","standard-webhooks","hmac","signing"],"description":"Standard Webhooks sign/verify primitives for anyhook","maintainers":[{"name":"sns45","email":"notifyshantanu@gmail.com"}],"readme":"# @anyhook/signing\n\n[Standard Webhooks](https://www.standardwebhooks.com) sign/verify primitives for [anyhook](https://github.com/sns45/anyhook) — usable standalone. Wire-compatible with the official `standardwebhooks` library (verified by a cross-library test).\n\n## Install\n\n```bash\nnpm i @anyhook/signing\n```\n\n## Overview\n\n- `generateSecret(bytes?)` → `whsec_`-prefixed base64 secret (≥24 bytes entropy).\n- `sign(secret, id, timestamp, payload)` → `v1,<base64 HMAC-SHA256>`.\n- `Signer` — multi-secret signing (space-joined) for zero-downtime key rotation.\n- `verify(headers, rawBody, secret)` — throws `WebhookVerificationError`; ±5min timestamp tolerance; timing-safe compare.\n- `createSigner()` — a `WebhookSigner` implementation to inject into `@anyhook/core` (keeps core zero-dep).\n\n```ts\nimport { Signer, verify } from '@anyhook/signing';\n\nconst headers = new Signer(secret).headers('msg_1', JSON.stringify(payload));\nconst body = verify(headers, rawBody, secret); // parsed JSON, or throws\n```\n\nSigned content is `` `${webhook-id}.${timestampSeconds}.${rawPayload}` ``; the key is the base64-decoded secret after stripping `whsec_`. MIT.\n","readmeFilename":"README.md"}