{"_id":"@beautinique/backend-cors","_rev":"8-61d507e65e2947f06dae7807cbf35461","name":"@beautinique/backend-cors","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@beautinique/backend-cors","version":"1.0.0","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.0","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"3396ff1184b780e9b7b7877ab40ffc36c3bcc9d2","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.0.tgz","fileCount":8,"integrity":"sha512-QabfCRx4bvRvc0K06Kr9W/KxQMWD1pKdyPbDlYnx9zeelq8ei0QXn85OPp7tCmhuHqwcAY56jAieECap7L9Glg==","signatures":[{"sig":"MEUCIQD58/wkRCQL8lNOTBtR84FVkH4tf5+JHtpuS1eaAX8MxwIgb0WO8pO6759b16mZfnhry1ULB5Wwj2uZ8GqvGzilsng=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28881},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"4c3030006abfa46ba7366d50cadbe622f58645ee","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.10.1","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.0_1783671474174_0.511520722797993","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@beautinique/backend-cors","version":"1.0.1","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.1","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"908f89b4432ac60f1c3c3b34babb07df83bc8639","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.1.tgz","fileCount":10,"integrity":"sha512-nhahth3t+IptjpziCPH+gqv/9+rBlAsHrdUszRT/Xl8FrTasMR0NL+5vfmBcaFYn/Ei5Lh+AEGsHSYB+opB6Fg==","signatures":[{"sig":"MEUCIHeyAbukMU2H8BehS5GOP62CMgHNVR66pGOuqC1Y8kiVAiEA9xRktA/vlGm9i+GS+h4TcAbU9Pa+Ywl2g0aVd/1brfY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29768},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"309063216b8eafe33d6f8bb794e6ee6b96aedb9d","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.8.0","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.1_1784656511789_0.2600222473828495","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@beautinique/backend-cors","version":"1.0.2","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.2","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"369a85cfd6d01f9ed77d8fd8263f670e3f8db811","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.2.tgz","fileCount":10,"integrity":"sha512-RrPIniLVF1d1GcsB5lP/o8bbgVM80PH55ZcJpBgB4K39GpE8OX0bMdQoOtc+p4pdIlCors2c1UY/6MS/sDlwGw==","signatures":[{"sig":"MEYCIQDU8V2s2eoLPBqrYFK+arCk9NB/kDpy9cqFVi28qcN1SQIhAPFvw7vxC5Uhq5elzRbEwQ2CTyhNUsbAKN+JWOWprLlF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29768},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"05329fd46e14baa677c4a6b5db4c1bd9b37be4ef","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.8.0","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@types/cors":"^2.8.19","@beautinique/backend-classes":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.2_1784711177389_0.6937745840054421","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@beautinique/backend-cors","version":"1.0.3","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.3","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"1909a75bde0f1f7a23f4f5a5598e5ec2449d160c","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.3.tgz","fileCount":10,"integrity":"sha512-2h2MwUm5ckiS5HcAnOEYiZN/Xh9Tt1ScUIsFEzp0Oa0ifswZyEOz65CjZUAFSJueYGpd6P4yG6lcmOUBB9rz9A==","signatures":[{"sig":"MEQCIB81wSgkMzWm9C2acYDxXsSVTDZ3+SP/4TL+R16weOWuAiBvgh5M0xBXaSCT4SBpykIcXitYQpU6xqNZzq8lPnkk3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37760},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"37c3d9e718dcb12eb41be217d3bd884a69f7ccc1","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.8.0","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.3_1784897386454_0.4149346156071978","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@beautinique/backend-cors","version":"1.0.4","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.4","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"1f6f9c9f818ed3ac2369cfed549ce0d29921433e","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.4.tgz","fileCount":10,"integrity":"sha512-RPh4Paxu1QOtrS4wEL6H19U7Q4uwfemlpRK/3ZdPUOEY9A1e9MToEgvyISQwFLoTJSNC368hqTUXDcwGd9t8DA==","signatures":[{"sig":"MEYCIQCs32n7JqbnFoxNltQmcTT/+X+ytBJeMS/X5iV4mA4BgAIhALq8hPpe1zTzyPFTjZbwCM4HzyviKX09tU9Xj/ibexAo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37760},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"e30737149d6d3916e61a909d2a30954882a1ce7e","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.8.0","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.4_1785442766052_0.5091349514233086","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@beautinique/backend-cors","version":"1.0.5","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.5","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"30cdf742e1a35d9e02086548aae86bbd7eb90a5e","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.5.tgz","fileCount":10,"integrity":"sha512-uh8cK/uF408QzfetMiREt3aZr0Txg22Dg6ZGnCNSlGAhy8dS1cNOAKaMG/8EYb6b6uyc4iTmKrwmyh0pLFOkJQ==","signatures":[{"sig":"MEQCIH8up8LmVlhyivQXHmhpD1LQu0KXLuKtdGbwx/M7p+RFAiAcqrrCkja4EEq1EE1t7TU+kg6L8zAIPUA7FqoOdnrjfQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38547},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"b026a3b9693c94e58dcd163010dbf39b6b79e7ea","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.8.0","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.5_1787039147829_0.3083460512658185","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@beautinique/backend-cors","version":"1.0.6","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/backend-cors@1.0.6","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"8ee0b206503ccfba586db91aaf55d93888b2b35b","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.6.tgz","fileCount":10,"integrity":"sha512-zMZHm2higg5cYttdp0VGhojo5NVxWVd3fL0HLU+fAH0ELkDyHK3UVQMLFirxc8xZbRRkOGsh9iIRzMWAZ5VbDQ==","signatures":[{"sig":"MEUCIG/GirecPuw+sKuqqxuBHW1KX9aT8YsputjP7l63gNJwAiEAmHxZ9ZPcHNQyY/9f447yJghG9XCd5ZevnX6XV56bbIo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38547},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"2807c53a8d389b6f0a36770b416bcc2026e40ca2","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/backend/cors"},"_npmVersion":"11.10.1","description":"Cors middleware for Beautinique project.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"cors":"^2.8.6","@beautinique/backend-classes":"^1.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/cors":"^2.8.19","@types/express":"^5.0.6"},"peerDependencies":{"express":"^5.2.1"},"_npmOperationalInternal":{"tmp":"tmp/backend-cors_1.0.6_1787219403740_0.6853946522124494","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@beautinique/backend-cors","version":"1.0.7","description":"Cors middleware for Beautinique project.","keywords":["cors","backend","beautinique","middleware"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/backend/cors"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","dev":"tsup --watch","lint":"eslint .","typecheck":"tsc --noEmit"},"publishConfig":{"access":"public"},"engines":{"node":">=24"},"dependencies":{"@beautinique/backend-classes":"^1.0.7","cors":"^2.8.6"},"peerDependencies":{"express":"^5.2.1"},"devDependencies":{"@types/cors":"^2.8.19","@types/express":"^5.0.6","typescript":"^6.0.3"},"gitHead":"3a5103fb9030969e849b1e69b02bbe7d1cab5fbe","_id":"@beautinique/backend-cors@1.0.7","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-QqCuphSOwbi2u315snzmQuCI0s0rD6dpvQRAfU5dfPYxlDP+BzOAOvXi1LyRlDhTyqKsAdzQ4arNDVFheQNw5g==","shasum":"64bd840f4c3f689a1c1b477c6afb79087f119cec","tarball":"https://registry.npmjs.org/@beautinique/backend-cors/-/backend-cors-1.0.7.tgz","fileCount":10,"unpackedSize":38547,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD9lnCBkAtFjqdybraRPYRIlenTELW0kTCsE0diOsg3PAIgMJLydgpe2GYjNPMpwlIGRYFWxTBmkHV9vbupgfmVzkE="}]},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"directories":{},"maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/backend-cors_1.0.7_1787576737100_0.12629963962341084"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-10T08:17:54.050Z","modified":"2026-08-24T13:05:37.585Z","1.0.0":"2026-07-10T08:17:54.347Z","1.0.1":"2026-07-21T17:55:11.931Z","1.0.2":"2026-07-22T09:06:17.547Z","1.0.3":"2026-07-24T12:49:46.604Z","1.0.4":"2026-07-30T20:19:26.219Z","1.0.5":"2026-08-18T07:45:47.964Z","1.0.6":"2026-08-20T09:50:03.899Z","1.0.7":"2026-08-24T13:05:37.232Z"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"author":{"name":"Nageshwar Pawar"},"license":"MIT","homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/backend/cors#readme","keywords":["cors","backend","beautinique","middleware"],"repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/backend/cors"},"description":"Cors middleware for Beautinique project.","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"readme":"# @beautinique/backend-cors\r\n\r\nA reusable, production-ready CORS middleware for Express-based Node.js services, built on top of the [`cors`](https://www.npmjs.com/package/cors) package.\r\n\r\n- Safer defaults - a sensible set of methods/headers/`maxAge` out of the box, so most services can call it with just an `origin`.\r\n- Fails fast - rejects `credentials: true` combined with `origin: '*'`/`true` at setup time, instead of a confusing runtime CORS failure.\r\n- Observable - an optional `onOriginDenied` hook fires whenever a request's `Origin` doesn't match your allowlist, for logging/alerting.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @beautinique/backend-cors\r\n```\r\n\r\n`express` is a peer dependency - install whichever version your service already uses.\r\n\r\n## Usage\r\n\r\n```ts\r\nimport { checkCors } from '@beautinique/backend-cors';\r\n\r\napp.use(\r\n  checkCors({\r\n    origin: ['https://app.example.com', 'https://admin.example.com'],\r\n    credentials: true,\r\n    onOriginDenied: (origin) => logger.warn({ origin }, 'CORS: origin denied'),\r\n  }),\r\n);\r\n```\r\n\r\n`checkCors` accepts any `cors` `CorsOptions`, plus the `onOriginDenied` hook - any option you omit falls back to this package's defaults below, not `cors`'s own.\r\n\r\n| Option           | Default                                                | Description                                                                                                                                                           |\r\n| ---------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `origin`         | `cors`'s default (`*`)                                 | String, `RegExp`, array, `boolean`, or a custom `(origin, callback)` matcher. Required in practice whenever `credentials: true` is used.                              |\r\n| `credentials`    | `false`                                                | Rejected at setup time if combined with `origin: '*'`/`true` - browsers reject that combination outright.                                                             |\r\n| `methods`        | `['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']` |                                                                                                                                                                       |\r\n| `allowedHeaders` | `['Content-Type', 'Authorization']`                    |                                                                                                                                                                       |\r\n| `exposedHeaders` | `['X-Request-Id']`                                     |                                                                                                                                                                       |\r\n| `maxAge`         | `600` (10 minutes)                                     | How long, in seconds, browsers may cache a preflight response.                                                                                                        |\r\n| `onOriginDenied` | `undefined`                                            | Called with the denied `Origin` header. Only fires for static `origin` values (string/`RegExp`/`boolean`/array) - a custom matcher function already has full control. |\r\n\r\nThe request is never rejected outright because of a denied origin - CORS headers are simply omitted, and it's the browser (not this middleware) that blocks the response from being read cross-origin.\r\n\r\n## Repository\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Homepage\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Issues\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages/issues\r\n\r\n## Author\r\n\r\nNageshwar Pawar\r\n\r\n## License\r\n\r\nThis package is licensed under the MIT License. See the root `LICENSE` file for details.\r\n","readmeFilename":"README.md"}