Backstage Integration
API stability data inside Backstage
The @coderifts/backstage-plugin adds a CodeRifts card to your Backstage entity pages. See risk scores, block rates, and breaking change patterns for every service.
API Stability
CodeRiftsBlock Rate
45%
Avg Risk Score
62/100
Total Analyses
28
Top Pattern
ENDPOINT_REMOVAL
Installation
Install the Backstage plugin from npm:
# npm npm install @coderifts/backstage-plugin # yarn yarn add @coderifts/backstage-plugin
Add to your Entity Page
Import the CodeRiftsCard component and add it to your Backstage entity page layout:
// packages/app/src/components/catalog/EntityPage.tsx import { CodeRiftsCard } from '@coderifts/backstage-plugin'; // Inside your entity page layout: <CodeRiftsCard repo="your-org/your-repo" apiKey="cr_live_..." />
Dynamic Repo Detection
Automatically detect the repo from the Backstage entity annotations:
import { useEntity } from '@backstage/plugin-catalog-react'; import { CodeRiftsCard } from '@coderifts/backstage-plugin'; const { entity } = useEntity(); const repo = entity.metadata.annotations?.['github.com/project-slug'] || ''; <CodeRiftsCard repo={repo} apiKey={apiKey} />
Configuration
For production, store the API key in your Backstage app config:
# app-config.yaml coderifts: apiKey: ${CODERIFTS_API_KEY}
Then read it in your component:
import { configApiRef, useApi } from '@backstage/core-plugin-api'; const config = useApi(configApiRef); const apiKey = config.getString('coderifts.apiKey');
Props Reference
| Prop | Type | Required | Description |
|---|---|---|---|
repo |
string | Yes | Repository in owner/repo format |
apiKey |
string | Yes | CodeRifts API key (cr_live_...) |
baseUrl |
string | No | Override API base URL (default: https://app.coderifts.com) |
What the card shows
Block Rate
Percentage of PRs blocked for breaking changes in the last 30 days.
Avg Risk Score
Average Omega risk score (0-100) across all analyzed PRs.
Total Analyses
Number of PR analyses performed by CodeRifts for this repo.
Top Pattern
Most common breaking change pattern detected (e.g., ENDPOINT_REMOVAL).