{"_id":"@anomira/node-sdk","_rev":"18-6af52bfcfd4a41b414d0de1ab710ea0e","name":"@anomira/node-sdk","dist-tags":{"latest":"0.2.7"},"versions":{"0.1.0":{"name":"@anomira/node-sdk","version":"0.1.0","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.0","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.js"},"dist":{"shasum":"082684b5b8d03be5f9f276fb1f4610656be57410","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.0.tgz","fileCount":7,"integrity":"sha512-xW39818sbyxTDn9MG7qAoGm3+OPJlLODog/CLmqwe2A/2NIw3PyFMZZzCVaAQNkRBAbMrcWoYcCvdlcZpFFm9g==","signatures":[{"sig":"MEQCIHY46zzqMVlQVw66fM8NJ8yeQiZJuRpTIKqTMZ17Ab/YAiBlkP+3Dnen1OuAhPfCmIjB16rBQruxtCQCVrAHzkXQyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":276372},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"be3eaf86b7a73537f204a6da84f7743244908222","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.0_1777910121195_0.03713359690531637","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@anomira/node-sdk","version":"0.1.1","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.1","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.js"},"dist":{"shasum":"336660b5a94ffddaeefebba20411831f1eabf05d","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.1.tgz","fileCount":8,"integrity":"sha512-AvQy7Ub1fbQfZoMSMTz3gnpY3V14/Gn3dWd2sO0oPGTDh8fpOaOIXLXWsxMaTwMc0WauBoLF48eME6P/yEbx4Q==","signatures":[{"sig":"MEQCIEALbnK57No1+zuuyK3vKpGHzxF99uFyM458r3B0TeWyAiBHhKYRF5GX3lHDwC8gSsT0fTloKu0jhQK6L9WG6I+8kw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":279907},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"e7e6bca38c80cface4edfde61e2ffa99f128216d","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.1_1777910507888_0.9887634743648719","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@anomira/node-sdk","version":"0.1.2","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.2","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.js"},"dist":{"shasum":"da33301961c7428a42e3633377de962e04a14996","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.2.tgz","fileCount":8,"integrity":"sha512-9BrDDS1Mp0JYB3YHcvxRldDWin6Rq/Kwi4DSRU8P5gwmRhKppjfZsO2KzVHYSQ1j1aGwsUl7ttzPTwwjG6D+Zw==","signatures":[{"sig":"MEUCIQDsPaBwBboI0RbrB+m7gihf6CRIcFv6pP5hbby1ftDOxwIgBn/+4fd+NaaywrW/sPbfuqnBeXqiZAxfNriberFmzYs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":279889},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"311f83a622a83f8dad232e2bd4457b8aa048b387","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.2_1777914507034_0.5999640603615488","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@anomira/node-sdk","version":"0.1.3","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.3","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.js"},"dist":{"shasum":"6ce1112b023b25d9db52b56ca4ee77f5c039325d","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.3.tgz","fileCount":8,"integrity":"sha512-MfJHEvwBMZSZ13f5k+jUZmwJKQTF1Hlo68gONfe4UmlrsDONyOlO1EgM111HuVtVlUkKdsEuV3vg2iPzsh7uSw==","signatures":[{"sig":"MEUCIC99zlch7qIbMPRU37bkBYXzQIvmmOogVKlmaa/ygsl0AiEAltgTCk9JaSLJa6RkJoIvmmOEmvya8an/sYwzx+jCYLw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":280702},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"d7c483c0006548153ce7a68b9e72666e9550aa2f","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.3_1777976578709_0.8868442783506945","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@anomira/node-sdk","version":"0.1.4","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.4","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.js"},"dist":{"shasum":"cafff6a6a0dc5e87ef3c1edaf9ecb903283eebe5","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.4.tgz","fileCount":8,"integrity":"sha512-o0IUUVcRUt+bWdGCigadagiy0YkDqHLN62joVlD1venGLZlNnEfXZMudhsfBMDmTOUSQ6oiOmAaNszfAi3Bi7A==","signatures":[{"sig":"MEUCIDulEPKkPasW/8y/HTpHAC9tllcbW7DHdeiCcG8OCBxcAiEA7kC+WSsh/i645H4s6ONKYha/1gVQwQtXpjc+DYionzY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":287924},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"8237b0e62e222ce47a044b0452d3d65cb37232a2","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.4_1777979294182_0.29623418139877744","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@anomira/node-sdk","version":"0.1.5","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.5","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"938dc4aec4d9fdb2c3d641f18f1a3fea34785c86","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.5.tgz","fileCount":9,"integrity":"sha512-a0FLRzPpYowyyAEZlB+z7xqnsRs17HX2Nq/WhAB5f+CBRUD0ecN3QN06JjsNy2LxLAROfaEMDXXGpjd6qbuaOw==","signatures":[{"sig":"MEYCIQCOJ70rgT5OTkfM51HQ3IEDdVgJBv1STPKekDJU7wzkgAIhAMzq37XvwE7dYr3BPW9m2X24pkgEAattMIOEeRC3RrmR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":517388},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"c7644611d469ac2f7d9bb8b44dd3272a65c52773","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.5_1778074603056_0.7253446096677141","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@anomira/node-sdk","version":"0.1.6","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.6","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"0c9e8eeb6b1c45bba6b52bf9ab9eca95ea87ef09","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.6.tgz","fileCount":9,"integrity":"sha512-BCaEikEARLwAgZS6adiX/AY/ZxCLvf2KqrYiU9LGBRI1/LwjpUQNnDWYv11amhgk7TKxchLJEi572BCA3mg0Tw==","signatures":[{"sig":"MEUCIQD4pJDC6sHp7gm0pw5uKDgocsGZcWguFLt9CkW/FpMN4gIgI5SuxcZ63Gin4iH4qildol7d51JGddgpgIU3rEIfJwY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":518398},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"6235edec2e4b963800c7ab3b248a410e6aeaf0e9","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.6_1778075740549_0.5117896749657918","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@anomira/node-sdk","version":"0.1.7","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.7","maintainers":[{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"53e10989d2a33244f6124b501e305d48c131fd2c","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.7.tgz","fileCount":9,"integrity":"sha512-3Bld7E7MqcuEquD0++FN8hbyUT6PDRkxr1MGKSASi6Kva3TJcGPg3Y/rAb6a6AnObb6829UPNC78IODpfnnN6Q==","signatures":[{"sig":"MEUCIGnRm4jH8mwMkMfIBXixecshdEfATjtRVDRoh3H9QIvSAiEA6MAki3ly3uo63yj+BjcCvGGARag11hjzLfj99GnDvrE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":530033},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"3f8853386eb5f501d2d8e8c27f4767922a434b8a","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"jaygreat2020","email":"ginuxtechacademy@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.7_1778299484203_0.9471164350522867","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@anomira/node-sdk","version":"0.1.9","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.1.9","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"3cc732fcb1f8f6418f750ac4748b0f8a6eeb5456","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.1.9.tgz","fileCount":9,"integrity":"sha512-ZrNiCKofwGoQwtcWnjh5j7fEvv69bAMcTIXe9PmDrpedbYYytEzJUZ6wk2EpAXNeGy5DfJI7C3T870tJ9PhZkA==","signatures":[{"sig":"MEUCIG4AezLcBZqdf3l6rj2bP9E0zUIEbU5c1wbTeHyG26UaAiEAuBnOgtob2gss3il2IzVykiTxsT6dGzT0gm1ApPjNgNk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":530145},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"0a4161a5d038e94a848f533c473a026136207e16","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.1.9_1778657195401_0.17907292758983617","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@anomira/node-sdk","version":"0.2.0","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.0","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"b8a1b396c36a88fe4ab4d1c2c6bf1457555caca3","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.0.tgz","fileCount":9,"integrity":"sha512-TvKWmExhlIVw8lMm2KR+pMuuifrtg4kD+EAo5sdGutzrxwWGdYwIBPIlOmZaLRVngTQ8zFulHtO3MCmojXREIw==","signatures":[{"sig":"MEUCIQC2/RRZvM8OsCbWkgla8D56oblnRrwEVvZIHEpHteTmbQIgDHNigSNkGojUTfjoD13EjQ3ocUsG4IOovxhqJFK/ZaU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":543314},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"b0738d8e7006f41822f7524752dbab9b6eab7208","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.0_1778688440043_0.9042975645278408","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@anomira/node-sdk","version":"0.2.2","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.2","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"ed37bd02872ad96ec165c3db254f69f6b97f7dbc","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.2.tgz","fileCount":9,"integrity":"sha512-7/2XDbzzBlaQH+wv2s2VRBTyJ2OpKlIpJRsjtkiIB8E5goKEgGV2VjUcdq0PM7x8LhUmLFoHR5gXZvc4ns3JSw==","signatures":[{"sig":"MEUCIQCq1hMP8LTg69fKte3FXrupG6T5PGBANmBRr9uzNzItbQIgYYto50vkh0j2JEf4xAljs7s4girLu7pUvaozej7ot3w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":881031},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"58de8431ce3a8c7f7d2dc75553cb5e12645013d3","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.2_1778837284090_0.2123599673669434","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@anomira/node-sdk","version":"0.2.3","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.3","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"f9cbb8520d6d001eaf9c88184a56214d06a23d58","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.3.tgz","fileCount":9,"integrity":"sha512-FcfyxJK7pePplUb6/AxTgl/sWCAfRX0GHZXHHPRnDGiciHCWBJZSbf+N1T/Qb5G7PbDVxtcu00GcLuXtyaMerw==","signatures":[{"sig":"MEUCIAVrDssqshCFJUEjThgE116erUY7MJSRqyN3vTzxxYUFAiEAqGi10u+/OhfC2KkTkWGPzNR3Vrn92qacp6EobJnBqoY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":907555},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"5973bc27a316afef42ea4a0185be0ddf6690068c","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.3_1778879195362_0.033567447653301","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@anomira/node-sdk","version":"0.2.4","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.4","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"b0ecb934060d7192b3ce15358130e448e2275a41","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.4.tgz","fileCount":9,"integrity":"sha512-Kto4tmvrwGxb6yBpN+nlW72/NTksinOTyen0TRdc37gFEtDTWppXVdfzssYE9MoH9EmwHlAXcuJ+psomgPvaxw==","signatures":[{"sig":"MEYCIQCq52+GVddOqBec+LuNYfL2Icozt2b07JD4gLn7lzzZ8QIhAJu/Byybsm8rbm8O6tNRW13R8BIQvOHHoZ7QyD1CCUUK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":944038},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"b9e7ad13d37ff644b319cae3cf220a60f0010e33","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"10.8.2","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.4_1778972141239_0.9253055848528429","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@anomira/node-sdk","version":"0.2.5","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.5","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"8952db1d187ef19b85f178b2113cfd51bc54fe8c","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.5.tgz","fileCount":9,"integrity":"sha512-TaPTLU1w1u6tOUxFKbprNVKtj6UJ3MFV7RDCSys99UdOZcRl1WeQXcx0bmsCCct6pp8NiaHPbRPwYklT3O21Cg==","signatures":[{"sig":"MEUCIQCWybhy4dszeGAGg021EUfkVCdnDLMS+swA5st9EyZ/mAIgaDOCyC9/fSTflT45LgRAep7mVEJwtYfX8IbQMrKpPbc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":979018},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"beba88a56bc8ee7c9a8c697ea3cf3510377ecd7b","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"11.12.1","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"25.9.0","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.5_1779227804358_0.6266649068113217","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@anomira/node-sdk","version":"0.2.6","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","_id":"@anomira/node-sdk@0.2.6","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"bin":{"anomira":"dist/cli.cjs"},"dist":{"shasum":"319be637929bed24d11d2f2107005c7a482ec36f","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.6.tgz","fileCount":9,"integrity":"sha512-3PmZarnY8Wou6e94WEofW6ljLP69Q8EsYDIe3k/YlPWZ0w3FINispr//4KWmvlHQyOTR23QTllac8ReLZ2bPWA==","signatures":[{"sig":"MEYCIQD4yfKet5140udaAwGF/6VGiDDe4PN8n+og9Y7EkljlQwIhAPKNYADzYmBjR3vFXiyCZzMWwzr9nGkslsCHFEytq35L","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":979002},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"423b3ae678dcb2e47647412b6d9b9094c6db2e17","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"_npmVersion":"11.12.1","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","directories":{},"_nodeVersion":"25.9.0","dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.2","vitest":"^1.6.0","typescript":"^5.4.5","@types/node":"^20.12.12","@types/express":"^4.17.21"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/node-sdk_0.2.6_1779257803111_0.6780760951904317","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"name":"@anomira/node-sdk","version":"0.2.7","description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","type":"module","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","bin":{"anomira":"dist/cli.cjs"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest"},"dependencies":{"@secretlint/core":"^13.0.0","@secretlint/secretlint-rule-preset-recommend":"^13.0.0"},"devDependencies":{"@types/express":"^4.17.21","@types/node":"^20.12.12","tsup":"^8.0.2","typescript":"^5.4.5","vitest":"^1.6.0"},"peerDependencies":{"express":">=4.0.0","fastify":">=4.0.0"},"peerDependenciesMeta":{"express":{"optional":true},"fastify":{"optional":true}},"keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"_id":"@anomira/node-sdk@0.2.7","gitHead":"b1b1c1e2f4e1fb0d3b0093263fa7fb6f497ba4fa","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ouCblV6xznNWGwLPgBBn1VLXjATP5KkBZZNOj6MrVJpSzy0YeMxd/1SGjsIcrnF2qvtRrXoTnEMifR+dRgt4ZQ==","shasum":"ca817c60d52b41a3cb688e90470e57e0fb904ee8","tarball":"https://registry.npmjs.org/@anomira/node-sdk/-/node-sdk-0.2.7.tgz","fileCount":9,"unpackedSize":1088666,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCqzNQN4Ko0JItV7nOzmWtxw3baLuqkClLkZWRnkffVdgIhALx4u55KGQQ4+UdEvkZVOYSq+GwgmRWqu/lix+nlyTLu"}]},"_npmUser":{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"},"directories":{},"maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-sdk_0.2.7_1782369272488_0.31493926867096467"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T15:55:21.110Z","modified":"2026-06-25T06:34:32.835Z","0.1.0":"2026-05-04T15:55:21.355Z","0.1.1":"2026-05-04T16:01:48.064Z","0.1.2":"2026-05-04T17:08:27.252Z","0.1.3":"2026-05-05T10:22:58.863Z","0.1.4":"2026-05-05T11:08:14.336Z","0.1.5":"2026-05-06T13:36:43.235Z","0.1.6":"2026-05-06T13:55:40.752Z","0.1.7":"2026-05-09T04:04:44.385Z","0.1.9":"2026-05-13T07:26:35.544Z","0.2.0":"2026-05-13T16:07:20.221Z","0.2.2":"2026-05-15T09:28:04.285Z","0.2.3":"2026-05-15T21:06:35.654Z","0.2.4":"2026-05-16T22:55:41.400Z","0.2.5":"2026-05-19T21:56:44.562Z","0.2.6":"2026-05-20T06:16:43.290Z","0.2.7":"2026-06-25T06:34:32.639Z"},"author":{"name":"Anomira","email":"sdk@anomira.io"},"license":"MIT","keywords":["security","api","monitoring","anomira","fraud-detection","api-security"],"description":"Anomira Node.js SDK — drop-in API security monitoring for Express and Fastify","maintainers":[{"name":"muyiwaloba","email":"jadcreationsltd@gmail.com"}],"readme":"# @anomira/node-sdk\n\nDrop-in API security monitoring for Node.js. Detect brute force, credential stuffing, account takeover, data scraping, path traversal, XSS, geo-velocity attacks, and more — in real time.\n\n[![npm version](https://img.shields.io/npm/v/@anomira/node-sdk)](https://www.npmjs.com/package/@anomira/node-sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Install\n\n```bash\nnpm install @anomira/node-sdk\n# or\nyarn add @anomira/node-sdk\n# or\npnpm add @anomira/node-sdk\n```\n\n**Requirements:** Node.js 18+, ESM or CommonJS.\n\n---\n\n## Quick Start (5 minutes)\n\n### 1. Set your environment variables\n\nCopy these into your `.env` file. Get the values from your [Anomira dashboard](https://app.anomira.io) under **Apps → Setup**.\n\n```env\nANOMIRA_API_KEY=ak_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nANOMIRA_APP_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n```\n\n> **Never hardcode these values.** Use environment variables or a secrets manager. Run `npx @anomira/node-sdk scan .` to catch any leaks before you commit.\n\n### 2. Add the middleware — pick your framework\n\n---\n\n## Express\n\nThe middleware goes **after** `express.json()` and **after your auth middleware** so it can read the authenticated user, and **before** your routes.\n\n### How user identity is captured automatically\n\nThe SDK automatically extracts the authenticated user ID from the request — no configuration required. It tries the following sources in order:\n\n| Priority | Source | Set by |\n|---|---|---|\n| 1 | `req.user.id` / `.sub` / `.userId` / `._id` / `.uid` | Passport.js, express-jwt v6, Firebase Admin, @fastify/jwt |\n| 2 | `req.auth.sub` / `.id` / `.userId` | express-jwt v7+ |\n| 3 | `req.userId` / `req.accountId` / `req.customerId` | Custom middleware |\n| 4 | `req.session.userId` / `req.session.user.id` | express-session |\n| 5 | JWT decode from `Authorization: Bearer ...` | **Automatic fallback — works even without explicit auth middleware** |\n\nTier 5 is the safety net: if your auth middleware hasn't set `req.user` yet, the SDK decodes the JWT token in the `Authorization` header itself (without verifying the signature — it only reads the `sub` / `id` claim). This means user tracking works even if middleware registration order is incorrect.\n\n**The only requirement:** if you use a custom auth pattern not listed above, pass `getUserId`:\n\n```ts\nconst anomira = new Anomira({\n  apiKey:    process.env.ANOMIRA_API_KEY!,\n  appId:     process.env.ANOMIRA_APP_ID!,\n  getUserId: (req) => (req as any).myCustomField?.userId,\n});\n```\n\n```ts\n// app.ts (TypeScript)\nimport express from \"express\";\nimport { Anomira } from \"@anomira/node-sdk\";\n\nconst app = express();\n\nconst anomira = new Anomira({\n  apiKey: process.env.ANOMIRA_API_KEY!,\n  appId:  process.env.ANOMIRA_APP_ID!,\n  service: \"my-api\",          // appears in the Logs dashboard\n  captureConsole: true,        // forwards console.log/warn/error to Logs\n});\n\napp.use(express.json());\napp.use(anomira.express());    // ← single line — instruments all routes\n\n// Your routes\napp.post(\"/api/auth/login\", (req, res) => { /* ... */ });\napp.get(\"/api/users/:id\",   (req, res) => { /* ... */ });\n\n// Always flush before shutdown\nprocess.on(\"SIGTERM\", async () => {\n  await anomira.flush();\n  process.exit(0);\n});\n\napp.listen(3000, () => console.log(\"API running on :3000\"));\n```\n\n**CommonJS:**\n\n```js\n// app.js\nconst express = require(\"express\");\nconst { Anomira } = require(\"@anomira/node-sdk\");\n\nconst app = express();\nconst anomira = new Anomira({\n  apiKey: process.env.ANOMIRA_API_KEY,\n  appId:  process.env.ANOMIRA_APP_ID,\n});\n\napp.use(express.json());\napp.use(anomira.express());\napp.listen(3000);\n```\n\n---\n\n## Fastify\n\n```ts\n// server.ts\nimport Fastify from \"fastify\";\nimport { Anomira } from \"@anomira/node-sdk\";\n\nconst app = Fastify({ logger: true });\n\nconst anomira = new Anomira({\n  apiKey:  process.env.ANOMIRA_API_KEY!,\n  appId:   process.env.ANOMIRA_APP_ID!,\n  service: \"my-api\",\n});\n\n// Register BEFORE your route plugins\nawait app.register(anomira.fastify());\n\n// Your routes\napp.post(\"/api/auth/login\", async (req, reply) => { /* ... */ });\napp.get(\"/api/users/:id\",   async (req, reply) => { /* ... */ });\n\nprocess.on(\"SIGTERM\", async () => {\n  await anomira.flush();\n  await app.close();\n});\n\nawait app.listen({ port: 3000, host: \"0.0.0.0\" });\n```\n\n---\n\n## What the middleware captures automatically\n\nOnce registered, the middleware records **every request** with zero additional code:\n\n| Signal | Description |\n|---|---|\n| HTTP method, path, status | Full request log in **API Events** |\n| Source IP + geolocation | Country, city, lat/lng |\n| Latency | `latencyMs` per request |\n| Brute force | Repeated failures on the same endpoint |\n| Rate abuse | Unusually high request rate from one IP |\n| Path traversal | `../`, `%2e%2e/`, null bytes in paths |\n| XSS | Script tags and injection payloads in bodies |\n| Scanner/bot probing | Systematic enumeration of endpoints |\n| Geo-velocity | Impossible logins from two countries within minutes |\n\n---\n\n## Manual event tracking\n\nUse these when the middleware can't infer the event on its own — e.g., application-level failures.\n\n### Getting the real client IP\n\n> **Important — do not use `req.ip` for the `ip` field.**\n>\n> Behind a reverse proxy (Nginx, AWS ALB, Cloudflare — which every production app uses), `req.ip` in Express without `trust proxy` configured returns `127.0.0.1` — the proxy's address, not the user's. This breaks geo-detection, IP blocking, and attack correlation.\n>\n> Always use `anomira.getClientIp(req)` instead. It reads `X-Forwarded-For`, `CF-Connecting-IP`, `X-Real-IP`, and other forwarded headers in the correct priority order automatically.\n\n```ts\n// ✅ Correct — works behind Nginx, Cloudflare, AWS ALB, any reverse proxy\nconst ip = anomira.getClientIp(req);\n\n// ❌ Wrong behind a proxy — returns 127.0.0.1 unless trust proxy is configured\nconst ip = req.ip;\n```\n\nIf you use `anomira.express()` or `anomira.fastify()` middleware and call `track()` **inside a request handler**, you can omit the `ip` field entirely — the SDK reads it from the active request context automatically.\n\n```ts\n// ✅ Also correct — IP is resolved from middleware context, no need to pass it\nanomira.track(\"auth.otp.failed\", { userId: req.body.phone });\n```\n\n### Examples\n\n```ts\n// Credential stuffing / failed login attempt\nawait anomira.trackLogin({\n  ip:      anomira.getClientIp(req),\n  userId:  req.body.email,     // email or user ID\n  success: false,              // false = failed attempt\n});\n\n// Successful login (enables geo-velocity tracking)\nawait anomira.trackLogin({\n  ip:      anomira.getClientIp(req),\n  userId:  user.id,\n  success: true,\n});\n\n// Failed OTP — otp_flood detection\nanomira.track(\"auth.otp.failed\", {\n  ip:     anomira.getClientIp(req),\n  userId: req.body.phone,\n  meta:   { endpoint: \"/api/verify-otp\" },\n});\n\n// SIM swap detection — call after any phone-based auth\nanomira.trackPhoneAuth({\n  ip:     anomira.getClientIp(req),\n  userId: user.id,\n  phone:  user.phone,\n});\n\n// Account takeover signal — e.g., password changed from new IP\nanomira.track(\"auth.account.takeover\", {\n  ip:     anomira.getClientIp(req),\n  userId: user.id,\n  meta:   { reason: \"password_changed_new_ip\" },\n});\n\n// Webhook replay — call when you detect a replayed webhook signature\nanomira.track(\"webhook.replay.detected\", {\n  ip:   anomira.getClientIp(req),\n  meta: { webhookId: req.headers[\"x-webhook-id\"] },\n});\n```\n\n---\n\n## Structured logging\n\nReplace `console.log` calls with `anomira.log` to push structured logs to the **Logs dashboard** with level, service name, and metadata.\n\n```ts\nanomira.log(\"info\",  \"User registered\",    { userId: user.id, plan: \"starter\" });\nanomira.log(\"warn\",  \"Slow DB query\",       { queryMs: 1240, table: \"transactions\" });\nanomira.log(\"error\", \"Payment failed\",      { reason: err.message, amount: 500_00 });\nanomira.log(\"debug\", \"Cache miss\",          { key: cacheKey });\n```\n\nOr set `captureConsole: true` in the constructor to automatically forward all `console.*` calls — no code changes needed.\n\n---\n\n## Blocklist & firewall check\n\nThe SDK syncs your dashboard's blocked IPs and firewall rules every 60 seconds. Use these checks in a gateway middleware before your routes:\n\n```ts\napp.use((req, res, next) => {\n  const ip = anomira.getClientIp(req);  // always use this, not req.ip\n\n  // Check if IP is manually blocked in the dashboard\n  if (anomira.isBlocked(ip)) {\n    return res.status(403).json({ error: \"Forbidden\" });\n  }\n\n  // Check firewall rules (pattern-based: path, method, header, body)\n  const match = anomira.matchFirewallRule({\n    url:     req.originalUrl,\n    method:  req.method,\n    body:    req.body,\n    headers: req.headers,\n    ip,\n  });\n\n  if (match) {\n    if (match.rule.action === \"block\") {\n      return res.status(403).json({ error: \"Request blocked\", rule: match.rule.name });\n    }\n    // action === \"flag\" — let it through but the dashboard will flag it\n  }\n\n  next();\n});\n```\n\n---\n\n## Shadow endpoint detection\n\nRegister your known API routes once on startup. Anomira will flag any traffic to undeclared endpoints in the **API Surface** view — a leading indicator of probing and abuse.\n\n```ts\n// Call this once, after all your routes are defined\nawait anomira.declareEndpoints([\n  { method: \"POST\", path: \"/api/auth/login\",       auth: false },\n  { method: \"POST\", path: \"/api/auth/register\",    auth: false },\n  { method: \"POST\", path: \"/api/auth/forgot\",      auth: false },\n  { method: \"GET\",  path: \"/api/users/:id\",        auth: true  },\n  { method: \"PUT\",  path: \"/api/users/:id\",        auth: true  },\n  { method: \"GET\",  path: \"/api/orders\",           auth: true  },\n  { method: \"POST\", path: \"/api/orders\",           auth: true  },\n  { method: \"GET\",  path: \"/api/health\",           auth: false },\n]);\n```\n\nExpress-style `:param` segments (`/users/:id`) are normalized automatically to match real traffic. Call this after your routes are registered so all paths are included.\n\n---\n\n## Secret scanner CLI\n\nScan your codebase for leaked secrets, API keys, and PII before they reach production.\n\n```bash\n# One-off scan (no install needed)\nnpx @anomira/node-sdk scan ./src\n\n# If the package is already installed\nnpx anomira scan ./src\n```\n\n**Options:**\n\n```bash\nnpx @anomira/node-sdk scan ./src           # scan a directory\nnpx @anomira/node-sdk scan .               # scan entire project\nnpx @anomira/node-sdk scan ./src --strict  # entropy analysis (catches unknown secrets)\nnpx @anomira/node-sdk scan ./src --json    # machine-readable JSON for CI\nnpx @anomira/node-sdk scan ./src --quiet   # violations only, no header\n```\n\n**Detects:**\n\n| Category | Examples |\n|---|---|\n| Cloud | AWS access keys, GCP service accounts, Azure connection strings |\n| Source control | GitHub (`ghp_`), GitLab (`glpat-`), NPM (`npm_`) tokens |\n| Payment | Stripe (`sk_live_`), Paystack secret keys |\n| Communication | Slack (`xoxb-`), Twilio, SendGrid |\n| Database | Connection strings with embedded passwords |\n| Auth | JWT tokens, bearer tokens, generic API keys |\n| PII | BVN/NIN (11-digit), card PANs, Nigerian phone numbers |\n| Unknown | High-entropy strings on secret-like variable names (`--strict`) |\n\nAdd to CI/CD — exits `1` if violations are found:\n\n```json\n{\n  \"scripts\": {\n    \"scan\": \"anomira scan ./src --json\"\n  }\n}\n```\n\n---\n\n## Graceful shutdown\n\nAlways flush the event buffer before your process exits. Unflushed events may be lost on a hard kill.\n\n```ts\nprocess.on(\"SIGTERM\", async () => {\n  await anomira.flush();\n  process.exit(0);\n});\n\n// For Fastify with lifecycle hooks:\napp.addHook(\"onClose\", async () => {\n  await anomira.flush();\n});\n```\n\n---\n\n## Environment variables reference\n\n| Variable | Required | Description |\n|---|---|---|\n| `ANOMIRA_API_KEY` | ✅ | Your API key — from dashboard under **Apps → Setup** |\n| `ANOMIRA_APP_ID` | ✅ | Your app ID — from dashboard under **Apps → Setup** |\n\n---\n\n## Configuration reference\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `apiKey` | `string` | — | API key (required) |\n| `appId` | `string` | — | App ID (required) |\n| `debug` | `boolean` | `false` | Log SDK activity to console |\n| `service` | `string` | `\"app\"` | Service name tag on all log entries |\n| `captureConsole` | `boolean` | `false` | Forward `console.*` to Logs dashboard |\n| `detect.bruteForce` | `boolean` | `true` | Brute force detection on auth endpoints |\n| `detect.rateAbuse` | `boolean` | `true` | High-rate abuse from single IP |\n| `detect.pathTraversal` | `boolean` | `true` | Path traversal payloads in URLs |\n| `detect.xss` | `boolean` | `true` | XSS payloads in request bodies |\n| `detect.scanDetection` | `boolean` | `true` | Endpoint scanner / bot probing |\n| `detect.geoVelocity` | `boolean` | `true` | Impossible travel between logins |\n\n---\n\n## Troubleshooting\n\n**No events showing in the dashboard?**\n1. Set `debug: true` in the constructor — the SDK will log every event it sends to the console.\n2. Check that `ANOMIRA_API_KEY` and `ANOMIRA_APP_ID` are set in your process environment (`console.log(process.env.ANOMIRA_API_KEY)`).\n3. Confirm the middleware is registered **before** your routes and **after** body parsers.\n4. Make sure you're not blocking outbound HTTPS traffic to `api.anomira.io`.\n\n**TypeScript errors on IP extraction?**\nUse `anomira.getClientIp(req)` — it handles all proxy headers and TypeScript types correctly. Do not use `req.ip` or `req.socket.remoteAddress` directly in production; both return the proxy address behind Nginx.\n\n**`flush()` taking too long on shutdown?**\nThe flush waits for in-flight HTTP requests to complete. If your process needs to exit fast, you can add a timeout:\n```ts\nawait Promise.race([\n  anomira.flush(),\n  new Promise((resolve) => setTimeout(resolve, 3000)),\n]);\n```\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}