{"_id":"@adonis-agora/authz-react","_rev":"9-e766d72333ff9ec00e62ff2385f3347b","name":"@adonis-agora/authz-react","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@adonis-agora/authz-react","version":"0.1.0","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@0.1.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"6496b7c8bda2990535fa79964239a618b7d027ca","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-0.1.0.tgz","fileCount":35,"integrity":"sha512-eu0EnrOAQ3UxzdCr5RzmmdWfN1u9Gc2OgPt/XNuPoDQR1gwrmcJXS50wqBS4I5p6ekclyPRpIMoV1XLLD/IIyQ==","signatures":[{"sig":"MEUCIAK3gTog2nAHQd8Ak9VID7u1GksorfOjccipjPAwkwNyAiEA9OFBylIJaRuWub5Asx6/nPGAWaXkW4so0nDlA0OxsjI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24728},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"},"repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.6.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_0.1.0_1784209495564_0.8910629772053789","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@adonis-agora/authz-react","version":"1.0.0","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@1.0.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"0558c28f50d64a54dda740bfe60ec0b54abac1e1","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-1.0.0.tgz","fileCount":35,"integrity":"sha512-/onVNyMal49mQ3+7DXSnNlOSWB9Vv0FLT2BpjofWV1wP09BY69XgiygFS7NrPPrjpo9p8HG0fWCpuKbnlR2UhQ==","signatures":[{"sig":"MEUCIARVgmiz3BZbuYPym+hAmVUCEDUOwMzSX5LmmffsH6q8AiEA1FgUDhjDsWeYJQeEKZ4ylqoY7bkMP7UWcf1w5R+gtzg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24922},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d90cb62b-e8b9-44c1-b89a-5d4eaf0c0ec3"}},"deprecated":"mis-versioned by a changesets peer-major bug; pre-1.0 package — use the 0.x line (latest)","repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.7.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_1.0.0_1784382944532_0.8027766540218932","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@adonis-agora/authz-react","version":"2.0.0","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@2.0.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"4aed06702b3448f65d27dfea1e2c8a2ef485f0f6","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-2.0.0.tgz","fileCount":35,"integrity":"sha512-XIhiYMvPqPj/5amsIAJ6ph0Sg2N3IiLqDmzuXZaOALMtzD9cMG1JXfO9RzVq+89iays1+5E9j7sZMt//2cRKeQ==","signatures":[{"sig":"MEUCID+X+tzr8G02csI7EBOZoowN222L2NfJe4xCxMumLE82AiEApivfGeKidDXihuiEGvcM4wugQUZM1l4luRw/cOWdL8E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25116},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d90cb62b-e8b9-44c1-b89a-5d4eaf0c0ec3"}},"deprecated":"mis-versioned by a changesets peer-major bug; pre-1.0 package — use the 0.x line (latest)","repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.8.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":"^0.8.0"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_2.0.0_1784385679674_0.47052480975968436","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@adonis-agora/authz-react","version":"3.0.0","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@3.0.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"e37502fb6419760488fd9a5634714968f33a2158","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-3.0.0.tgz","fileCount":35,"integrity":"sha512-nRPqr5oAeAVjwnjmdKAUXtwbc5WvEmKJ7tvNWwFa00SJj7fXhtm5arDDN8v47at7gkIWLwJ9mRZQJlSvaoLD8A==","signatures":[{"sig":"MEUCIQDahbFQ+Pzf5Tfdby4hJcSWIw2JRUbDG0lOz8cv4qcW9gIgXkiQimSiZM+gYXH9LcyjqYV6lEChCleQtLe4/5Wx0rY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25310},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d90cb62b-e8b9-44c1-b89a-5d4eaf0c0ec3"}},"deprecated":"mis-versioned by a changesets peer-major bug; pre-1.0 package — use the 0.x line (latest)","repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.9.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":"^0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_3.0.0_1784422978567_0.30649279976238697","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@adonis-agora/authz-react","version":"3.0.1","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@3.0.1","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"639eae2c4a4b0dc5803ca60af40b30cb860ddefb","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-3.0.1.tgz","fileCount":35,"integrity":"sha512-i+UlZHHeDyZAtxNxcapfh6lRuvQTP60gIQEZnEmOrpegvmMGTfvpNPKkaXFNqXw1MslAIvtD92Q8e/vYgIgTrA==","signatures":[{"sig":"MEUCIAc0gJRb9V8wcrvPCLE/FXJO0WAh9BE/t5gNc8Qy6NzBAiEA7NfL670uHPKNQ5FdtmZE/OAAzbUBqbkZAzplRSfkUMs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@3.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25510},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d90cb62b-e8b9-44c1-b89a-5d4eaf0c0ec3"}},"deprecated":"mis-versioned by a changesets peer-major bug; pre-1.0 package — use the 0.x line (latest)","repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.10.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":">=0.9.0 <1"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_3.0.1_1784549998653_0.49260233250701124","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@adonis-agora/authz-react","version":"0.2.0","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@0.2.0","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"f96a372b32e7f39d8dead2c61db6956881fd3b8c","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-0.2.0.tgz","fileCount":35,"integrity":"sha512-NLH3PI/e8jHqCJB32XZH37oHZjcSwsNACMvXIwwOnS4s0W43tFTXDtpkKCs7MSC6cI2R3ckUlgD0eZLLL1WtSw==","signatures":[{"sig":"MEUCIQDdg7f6TRHHgv4ydObgIL45vaHqqa7h9oBwrB5H0BfjsgIgC6gNvnX0KOZmHunfA2PeEss69wCcwxEk9M0Xq3of1L0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25915},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d90cb62b-e8b9-44c1-b89a-5d4eaf0c0ec3"}},"repository":{"url":"git+https://github.com/DavideCarvalho/adonis-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.0","react":"^19.2.6","vitest":"^3.0.0","react-dom":"^19.2.6","typescript":"^5.4.0","@types/node":"^20.0.0","@types/react":"^19.0.0","@inertiajs/react":"^3.3.0","@types/react-dom":"^19.0.0","@adonis-agora/authz":"0.10.0","@testing-library/react":"^16.0.0"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":">=0.9.0 <1"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_0.2.0_1784550191131_0.5413683523231787","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adonis-agora/authz-react","version":"0.2.1","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora"],"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","_id":"@adonis-agora/authz-react@0.2.1","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"dist":{"shasum":"e42798eabd81e632b0f3920f304f7ec32bcb7859","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-0.2.1.tgz","fileCount":36,"integrity":"sha512-8vRB4uZMHW/nseTSKYCpjepR+HCvzhHmJ+wT0ryZRFkc06rM/sG18UbdlVB/cQFGsfVkIZDngzeaRVTgjgdP2g==","signatures":[{"sig":"MEUCIA4TmQOTGaEAr9laQGS6G2wUGeyNKuJtSSiRyyrleAcIAiEArSme3jSiW6FtP+BOkmNcCpGSrhzvU6B7UTX5jSA3LPU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35804},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.6.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5358b236-94f6-475b-8896-ef81819373e7"}},"repository":{"url":"git+https://github.com/DavideCarvalho/adonis-agora-authz.git","type":"git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"jsdom":"25.0.1","react":"19.2.8","vitest":"3.2.7","react-dom":"19.2.8","typescript":"5.9.3","@types/node":"20.19.43","@types/react":"19.2.18","@inertiajs/react":"3.6.1","@types/react-dom":"19.2.4","@adonis-agora/authz":"0.10.2","@testing-library/react":"16.3.2"},"peerDependencies":{"react":"^19.2.6","react-dom":"^19.2.6","@inertiajs/react":"^3.3.0","@adonis-agora/authz":">=0.9.0 <1"},"_npmOperationalInternal":{"tmp":"tmp/authz-react_0.2.1_1787106601591_0.07751466303664634","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@adonis-agora/authz-react","version":"0.2.2","description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/DavideCarvalho/adonis-agora-authz.git","directory":"packages/react"},"author":"Davi Carvalho <davi@goflip.ai>","type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js","default":"./dist/src/index.js"},"./server":{"types":"./dist/src/share.d.ts","import":"./dist/src/share.js","default":"./dist/src/share.js"}},"sideEffects":false,"peerDependencies":{"@adonis-agora/authz":">=0.9.0 <1","@inertiajs/react":"^3.3.0","react":"^19.2.6","react-dom":"^19.2.6"},"devDependencies":{"@inertiajs/react":"3.6.1","@tanstack/intent":"^0.3.2","@testing-library/react":"16.3.2","@types/node":"20.19.43","@types/react":"19.2.18","@types/react-dom":"19.2.4","jsdom":"25.0.1","react":"19.2.8","react-dom":"19.2.8","typescript":"5.9.3","vitest":"3.2.7","@adonis-agora/authz":"0.10.6"},"engines":{"node":">=20.6.0"},"keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora","tanstack-intent"],"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run --passWithNoTests","test:watch":"vitest","typecheck":"tsc -p tsconfig.json --noEmit"},"_nodeVersion":"22.23.2","_id":"@adonis-agora/authz-react@0.2.2","dist":{"integrity":"sha512-VVJaw2vpnbxSCzC+ZStypnQY3jY2xsI2OqC8ESxgsZsUyHrSiuMg0LXzIvny+JGGX4nANfgmzzBeeWPWjfmfOw==","shasum":"81d8c10d2a469fdfef0c63b27213f8e19625f357","tarball":"https://registry.npmjs.org/@adonis-agora/authz-react/-/authz-react-0.2.2.tgz","fileCount":37,"unpackedSize":43417,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adonis-agora%2fauthz-react@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEbV/B3Noznh5zdIoCVgB1hQnABAN0rQQLk4MvdoA/BnAiEA/ax9zPXun0O9OoRhlX9qnASpmWrv67+tDf0ts7S3+uQ="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5358b236-94f6-475b-8896-ef81819373e7"}},"directories":{},"maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/authz-react_0.2.2_1787578617737_0.8475817948051361"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T13:44:55.385Z","modified":"2026-08-24T13:36:58.257Z","0.1.0":"2026-07-16T13:44:55.719Z","1.0.0":"2026-07-18T13:55:44.687Z","2.0.0":"2026-07-18T14:41:19.797Z","3.0.0":"2026-07-19T01:02:58.695Z","3.0.1":"2026-07-20T12:19:58.793Z","0.2.0":"2026-07-20T12:23:11.265Z","0.2.1":"2026-08-19T02:30:01.743Z","0.2.2":"2026-08-24T13:36:57.888Z"},"author":"Davi Carvalho <davi@goflip.ai>","license":"MIT","keywords":["adonisjs","adonis","inertia","react","authorization","authz","rbac","agora","tanstack-intent"],"repository":{"type":"git","url":"git+https://github.com/DavideCarvalho/adonis-agora-authz.git","directory":"packages/react"},"description":"React/Inertia bindings for @adonis-agora/authz: AuthzProvider, useAuthz, useCan, <Can>, and a server-side buildAuthzShare() for the Inertia share.","maintainers":[{"name":"dudousxd","email":"davi_carvalho96@hotmail.com"}],"readme":"# `@adonis-agora/authz-react`\n\nClient-side authorization for **Inertia + React**, mirroring the server's decisions in your frontend\n— part of the [Agora](https://github.com/DavideCarvalho) ecosystem, the React binding for\n[`@adonis-agora/authz`](../core).\n\n`@adonis-agora/authz-react` mirrors the server's authorization decisions in your Inertia + React\nfrontend, so a button you hide with `<Can>` and a route your Bouncer ability protects agree on\nexactly the same rule. The package ships two entry points:\n\n- **`@adonis-agora/authz-react`** — the client barrel: the `<AuthzProvider>` context, the `useAuthz` /\n  `useCan` hooks, the `<Can>` gating component and the wildcard matcher. Client-safe: it never imports\n  `@adonis-agora/authz`, so the server engine never lands in your browser bundle.\n- **`@adonis-agora/authz-react/server`** — the single server helper, `buildAuthzShare()`, which turns\n  an `AuthzService` + a user into the payload the client reads.\n\n**Fail-closed everywhere.** With no share available — logged-out, outside an Inertia `<App>`, or\nbefore the provider mounts — `useAuthz()` returns `{ roles: [], permissions: [] }`, so `useCan()` is\n`false` and `<Can>` renders its `fallback`. The UI never shows a control the user can't use.\n\n## Install\n\n```sh\nnpm i @adonis-agora/authz-react\n```\n\nPeer dependencies (an Inertia + React Adonis app already has these):\n\n| Peer | Version |\n|---|---|\n| `@adonis-agora/authz` | `>=0.9.0 <1` |\n| `@inertiajs/react` | `^3.3.0` |\n| `react` | `^19.2.6` |\n| `react-dom` | `^19.2.6` |\n\n## The data flow\n\nThe client never re-computes authorization. The server resolves the user's **effective** roles and\npermissions once — the same union `can()` consults — and ships them as an Inertia shared prop. Every\nclient primitive decides from that snapshot.\n\n### 1. Push the share from the server\n\n`buildAuthzShare()` reads `effectiveRoles` / `effectivePermissions` (store ∪ `roleGrants` ∪\n`resolveRoles` ∪ context), so what the UI sees matches what the server would decide. Call it in the\nInertia middleware's `sharedData`.\n\n```ts\n// config/inertia.ts\nimport { defineConfig } from '@adonisjs/inertia'\nimport { AuthzService } from '@adonis-agora/authz'\nimport { buildAuthzShare } from '@adonis-agora/authz-react/server'\n\nexport default defineConfig({\n  sharedData: {\n    // `ctx.auth.user` works with @adonisjs/auth; use ctx.auth.getUser() for authkit.\n    authz: async (ctx) => {\n      const authz = await ctx.containerResolver.make(AuthzService)\n      return buildAuthzShare(authz, ctx.auth?.user ?? null)\n    },\n  },\n})\n```\n\n`buildAuthzShare(authz, user, scope?)` returns `{ roles, permissions }`. A `null`/`undefined` user\n(anonymous) yields the empty share — no leak. Pass a `TenantScope` as the third argument to snapshot a\nspecific tenant's grants.\n\n### 2. Type the shared prop\n\n`AuthzSharedProps` is the Inertia shared-prop contract the client reads. It has an index signature, so\nyou can intersect it with your own shared props.\n\n```ts\n// types/inertia.ts\nimport type { AuthzSharedProps } from '@adonis-agora/authz-react'\n\nexport interface AppPageProps extends AuthzSharedProps {\n  user: { id: number; fullName: string } | null\n}\n```\n\n### 3. Gate the UI\n\n`useCan`, `useAuthz` and `<Can>` read `usePage().props.authz` automatically — no provider required\ninside a live Inertia app.\n\n```tsx\n// resources/js/pages/posts/index.tsx\nimport { Can, useCan, useAuthz } from '@adonis-agora/authz-react'\n\nexport default function PostsIndex() {\n  const canCreate = useCan('posts.create') // wildcard-aware\n  const { roles } = useAuthz() // raw snapshot\n\n  return (\n    <div>\n      {canCreate && <a href=\"/posts/new\">New post</a>}\n\n      <Can permission=\"posts.edit\">\n        <button>Edit</button>\n      </Can>\n\n      <Can role=\"admin\" fallback={<span>Read-only</span>}>\n        <button>Delete</button>\n      </Can>\n\n      {roles.includes('admin') && <AdminBadge />}\n    </div>\n  )\n}\n```\n\n## Hooks\n\n### `useAuthz()`\n\nReturns the raw `{ roles: string[]; permissions: string[] }` snapshot — the effective grants for the\ncurrent user. Precedence: an explicit `<AuthzProvider>` value wins over the Inertia shared prop\n(`usePage().props.authz`); with neither, it returns the empty share.\n\n```tsx\nimport { useAuthz } from '@adonis-agora/authz-react'\n\nfunction RoleBadges() {\n  const { roles } = useAuthz()\n  return <>{roles.map((r) => <span key={r} className=\"badge\">{r}</span>)}</>\n}\n```\n\n`usePage()` throws outside an Inertia `<App>`; `useAuthz` catches that so the hook (and everything\nbuilt on it) stays testable with just an `<AuthzProvider>`, without mounting the whole Inertia tree.\n\n### `useCan(permission)`\n\nWildcard-aware boolean check against the snapshot's `permissions`. The granted side may use wildcards\n(`posts.*`), the checked ability is always literal — the same matching rules as the server.\n\n```tsx\nconst canPublish = useCan('posts.publish')\n// A user granted `posts.*` → true. Anonymous / no share → false.\n```\n\n## `<Can>` — the gating component\n\nRenders `children` only when the user satisfies `permission` (wildcard-aware) or holds `role` (exact\nmatch); otherwise it renders `fallback` (default `null`). Fail-closed: with neither prop supplied, or\nno share available, it renders nothing.\n\n```tsx\nimport { Can } from '@adonis-agora/authz-react'\n\n// permission gate (wildcards apply)\n<Can permission=\"posts.edit\">\n  <EditButton />\n</Can>\n\n// role gate (exact)\n<Can role=\"admin\">\n  <DangerZone />\n</Can>\n\n// with an explicit fallback\n<Can permission=\"billing.manage\" fallback={<UpgradePrompt />}>\n  <BillingSettings />\n</Can>\n```\n\n`CanProps`:\n\n| Prop | Type | Notes |\n|---|---|---|\n| `permission` | `string?` | Wildcard-aware permission to check. |\n| `role` | `string?` | Role to check (exact match against `roles`). |\n| `fallback` | `ReactNode?` | Rendered when denied. Default `null`. |\n| `children` | `ReactNode` | Rendered when allowed. |\n\nWhen both `permission` and `role` are passed, `permission` takes precedence — `role` is only consulted\nif `permission` is omitted. Use two nested `<Can>`s (an AND) if you need both.\n\n## `<AuthzProvider>` / `AuthzContext`\n\nThe provider is **optional** — inside a live Inertia app the primitives read the shared prop directly.\nReach for it when there is no Inertia page context: unit tests, Storybook, or a non-Inertia React\nshell that wants to inject the snapshot by hand. A provided value takes precedence over any Inertia\nshared prop.\n\n```tsx\n// posts-index.test.tsx\nimport { render, screen } from '@testing-library/react'\nimport { AuthzProvider } from '@adonis-agora/authz-react'\nimport PostsIndex from '#pages/posts/index'\n\ntest('shows the edit button for editors', () => {\n  render(\n    <AuthzProvider value={{ roles: ['editor'], permissions: ['posts.*'] }}>\n      <PostsIndex />\n    </AuthzProvider>,\n  )\n  expect(screen.getByText('Edit')).toBeVisible()\n})\n```\n\n- `AuthzContextValue` — `{ roles: string[]; permissions: string[] }`, the shape the provider carries.\n- `AuthzProviderProps` — `{ value: AuthzContextValue; children: ReactNode }`.\n- `AuthzContext` — the raw React context, exported for advanced composition (e.g. a custom provider\n  that derives the value differently). Reading it directly returns `undefined` when no provider is\n  mounted; prefer `useAuthz()`, which folds in the Inertia fallback and the empty-share default.\n\n## Client-safe matcher\n\nThe same wildcard matcher the server uses, ported with **no** server import so it never drags\n`@adonis-agora/authz` into the browser bundle. Useful for gating against an ad-hoc permission set\n(e.g. one you fetched yourself).\n\n```ts\nimport { permissionMatches, permissionSatisfied } from '@adonis-agora/authz-react'\n\npermissionMatches('posts.*', 'posts.edit') // true  (granted, required)\npermissionMatches('posts', 'posts.edit') // false (needs a trailing *)\npermissionSatisfied(['billing.*', 'posts.read'], 'billing.refund') // true\n```\n\n- `permissionMatches(granted, required)` — does a single granted pattern match the (always-literal)\n  required ability?\n- `permissionSatisfied(granted, required)` — does **any** pattern in the granted iterable match? This\n  is what `useCan` / `<Can>` run over the snapshot.\n\n## Server subpath — `AuthzShare`\n\n`@adonis-agora/authz-react/server` exports `buildAuthzShare()` and its return type `AuthzShare`\n(`{ roles: string[]; permissions: string[] }`). It is the only export that imports `AuthzService`,\nwhich is why it lives on a separate subpath — importing it from a client component would pull the\nserver engine into the bundle. Keep it to server files (the Inertia middleware, tests).\n\n```ts\nimport { buildAuthzShare, type AuthzShare } from '@adonis-agora/authz-react/server'\n```\n\n`buildAuthzShare` only needs the `effectiveRoles` / `effectivePermissions` slice of `AuthzService`, so\na stub with just those two methods satisfies it in a test.\n\n## Links\n\n- Repo: https://github.com/DavideCarvalho/adonis-authz\n- Docs: https://github.com/DavideCarvalho/adonis-authz/blob/master/docs/react.mdx\n- Changelog: https://github.com/DavideCarvalho/adonis-authz/blob/master/packages/react/CHANGELOG.md\n- Server package: [`@adonis-agora/authz`](https://github.com/DavideCarvalho/adonis-authz/tree/master/packages/core)\n\n## License\n\nMIT\n","readmeFilename":""}