{"_id":"@coderifts/backstage-plugin","_rev":"2-7bec2f82531413b1ca84ce88eff2f083","name":"@coderifts/backstage-plugin","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@coderifts/backstage-plugin","version":"1.0.0","keywords":["backstage","plugin","api-governance","coderifts","breaking-change","risk-scoring","openapi"],"license":"MIT","_id":"@coderifts/backstage-plugin@1.0.0","maintainers":[{"name":"zsobpeter","email":"zsobpeter@gmail.com"}],"homepage":"https://coderifts.com/integrations/backstage/","bugs":{"url":"https://github.com/coderifts/app/issues"},"dist":{"shasum":"ead466e7171e0ef310af659540a274b8d5643dc9","tarball":"https://registry.npmjs.org/@coderifts/backstage-plugin/-/backstage-plugin-1.0.0.tgz","fileCount":4,"integrity":"sha512-Xr84+VyCvT3fypSYEzrVBx9s54J2Ffd99cmnlxAAVJqNPFWqnGFkcHSk/stqQJY3fEsxJvC9t+HsLbEAyFvTTg==","signatures":[{"sig":"MEUCIQDO2kFqMbyysCBGIU796FdzKDWl+e3kUypU7cBPvN7akQIgJgFqrMwWhWT9Lz1gjCQN6mCA14MqP0+JaTkKDq2oLbY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5594},"main":"index.js","types":"index.d.ts","engines":{"node":">=18"},"_npmUser":{"name":"zsobpeter","email":"zsobpeter@gmail.com"},"repository":{"url":"git+https://github.com/coderifts/app.git","type":"git"},"_npmVersion":"10.9.2","description":"CodeRifts API governance plugin for Backstage — risk scoring, breaking change detection, and PR-level governance decisions","directories":{},"_nodeVersion":"22.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/backstage-plugin_1.0.0_1773611225198_0.8627341544061895","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Not maintained. CodeRifts today: https://coderifts.com/"}},"time":{"created":"2026-03-15T21:47:05.095Z","modified":"2026-10-04T18:12:52.185Z","1.0.0":"2026-03-15T21:47:05.328Z"},"bugs":{"url":"https://github.com/coderifts/app/issues"},"license":"MIT","homepage":"https://coderifts.com/integrations/backstage/","keywords":["backstage","plugin","api-governance","coderifts","breaking-change","risk-scoring","openapi"],"repository":{"url":"git+https://github.com/coderifts/app.git","type":"git"},"description":"CodeRifts API governance plugin for Backstage — risk scoring, breaking change detection, and PR-level governance decisions","maintainers":[{"name":"zsobpeter","email":"zsobpeter@gmail.com"}],"readme":"# @coderifts/backstage-plugin\n\nCodeRifts API governance plugin for [Backstage](https://backstage.io).\n\nAdds PR-level API risk scoring, breaking change detection, and governance decisions to your Backstage developer portal.\n\n## Installation\n\n```bash\nnpm install @coderifts/backstage-plugin\n```\n\n## Usage\n\n```javascript\nconst { analyzeApiRisk, formatForBackstage } = require('@coderifts/backstage-plugin');\n\nconst analysis = await analyzeApiRisk({\n  apiKey: 'cr_live_...',\n  repo: 'org/api-repo',\n  baseRef: 'main',\n  headRef: 'feature/payment-v2'\n});\n\nconst result = formatForBackstage(analysis);\nconsole.log(result.decision); // ALLOW | WARN | REQUIRE_APPROVAL | BLOCK\nconsole.log(result.riskScore); // 0-100\n```\n\n## API\n\n### `analyzeApiRisk(options)`\n\nAnalyze API diff risk using the CodeRifts API.\n\n| Option | Type | Required | Description |\n|--------|------|----------|-------------|\n| `apiKey` | string | Yes | CodeRifts API key (`cr_live_...`) |\n| `repo` | string | Yes | Repository in `owner/repo` format |\n| `baseRef` | string | Yes | Base branch or commit SHA |\n| `headRef` | string | Yes | Head branch or commit SHA |\n| `specPath` | string | No | Path to OpenAPI spec file |\n\n### `getRiskLevel(score)`\n\nConvert a numeric Omega_API score (0-100) to a risk level label.\n\n| Score Range | Level |\n|-------------|-------|\n| 0-24 | `ALLOW` |\n| 25-44 | `WARN` |\n| 45-69 | `REQUIRE_APPROVAL` |\n| 70-100 | `BLOCK` |\n\n### `formatForBackstage(analysis)`\n\nFormat a raw CodeRifts analysis result into a structured object for Backstage display.\n\n## Links\n\n- [CodeRifts](https://coderifts.com)\n- [Backstage Integration Guide](https://coderifts.com/integrations/backstage/)\n- [GitHub App](https://github.com/apps/coderifts)\n- [Documentation](https://coderifts.com/docs/)\n","readmeFilename":"README.md"}