{"_id":"@a-company/portal-sdk","name":"@a-company/portal-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@a-company/portal-sdk","version":"0.1.0","description":"Runtime SDK for checking portals in applications","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./decorators":{"types":"./dist/decorators/index.d.ts","import":"./dist/decorators/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"dependencies":{"@a-company/portal-core":"*"},"devDependencies":{"@types/node":"^20.10.0","tsup":"^8.0.1","typescript":"^5.3.3"},"publishConfig":{"access":"public"},"author":{"name":"ascend42"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ascend42/a-paradigm.git","directory":"packages/portal/sdk"},"bugs":{"url":"https://github.com/ascend42/a-paradigm/issues"},"homepage":"https://github.com/ascend42/a-paradigm#readme","keywords":["paradigm","portal","sdk","authorization","runtime"],"engines":{"node":">=18.0.0"},"gitHead":"c0c9c22fa3d85db8b3f314c5c8edef44a5d3eb25","_id":"@a-company/portal-sdk@0.1.0","_nodeVersion":"24.12.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-Tc1bUK7QZzAwMP8cbbGT/MjLxhsjhNj9vY16upEyHDcmPcAE+0XIJuVYhk6pPLY3B4CSRQdDaUNFxoAEseqSsg==","shasum":"a49ed0d356bc82af45f1e93d8908520fb9f4b2df","tarball":"https://registry.npmjs.org/@a-company/portal-sdk/-/portal-sdk-0.1.0.tgz","fileCount":8,"unpackedSize":38987,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDUJE8TYSB23Q6+SOFSUKNSWvlJ7FksaSN0zE+UvFGrUgIhAJ40WVfL0EZ+/9fuGVNvljRguRpTAq+4OHC8AhrKAaP9"}]},"_npmUser":{"name":"ascend42","email":"ascend@a-company.org"},"directories":{},"maintainers":[{"name":"ascend42","email":"ascend@a-company.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/portal-sdk_0.1.0_1771872377887_0.5569562826430907"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-23T18:46:17.686Z","0.1.0":"2026-02-23T18:46:18.072Z","modified":"2026-02-23T18:46:18.409Z"},"maintainers":[{"name":"ascend42","email":"ascend@a-company.org"}],"description":"Runtime SDK for checking portals in applications","homepage":"https://github.com/ascend42/a-paradigm#readme","keywords":["paradigm","portal","sdk","authorization","runtime"],"repository":{"type":"git","url":"git+https://github.com/ascend42/a-paradigm.git","directory":"packages/portal/sdk"},"author":{"name":"ascend42"},"bugs":{"url":"https://github.com/ascend42/a-paradigm/issues"},"license":"MIT","readme":"# @a-company/portal-sdk\n\n> Runtime SDK for checking gates in applications\n\nUse gates at runtime to enforce authorization rules defined in your `portal.yaml`.\n\n## Installation\n\n```bash\nnpm install @a-company/portal-sdk\n```\n\n## Usage\n\n```typescript\nimport { createGateClient, checkGate } from '@a-company/portal-sdk';\n\n// Initialize the client with your portal config\nconst client = await createGateClient('./portal.yaml');\n\n// Check if a gate allows access\nconst canCheckout = await client.check('checkout', {\n  user: currentUser,\n  context: { cartItems: cart.items }\n});\n\nif (canCheckout.allowed) {\n  // Proceed with checkout\n} else {\n  // Handle denial\n  console.log(canCheckout.reason);\n}\n```\n\n### With Decorators\n\n```typescript\nimport { Gate } from '@a-company/portal-sdk/decorators';\n\nclass CheckoutService {\n  @Gate('checkout')\n  async processCheckout(userId: string) {\n    // Only runs if gate passes\n  }\n}\n```\n\n## Documentation\n\nSee the [main repository](https://github.com/ascend42/a-paradigm) for full documentation.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-d4957b4fd20d02b41c5cca9335d03aaf"}