Overview
The advice plugin will:- Provide a full-page route at
/advice - Expose a reusable
AdviceCardcomponent - Fetch random advice from the Advice Slip JSON API and render it inside an
InfoCard

AdviceCard will display a fresh nugget of wisdom.
1. Scaffold the Plugin
Backstage’s CLI can generate all the boilerplate for you. In your Backstage root directory, run:The plugin ID (
advice) is used for routing, packaging, and yarn workspace commands.2. Inspect Generated Files
package.json
routes.ts
Defines a route reference for full-page navigation:plugin.ts
Registers the plugin and its full-page extension:ExampleComponent (Placeholder)
Located atplugins/advice/src/components/ExampleComponent.tsx:
3. Register the /advice Route
In your application’s main routing file (e.g. packages/app/src/App.tsx), import and add the AdvicePage:
http://localhost:3000/advice shows your placeholder page.
4. Create the AdviceCard Component
We’ll build a compact card that can be embedded in any entity page.4.1 Define the Component
Createplugins/advice/src/components/AdviceCard.tsx:
index.ts for easy imports:

4.2 Expose the Extension
Inplugins/advice/src/plugin.ts, add:
plugins/advice/src/index.ts to re-export:
5. Embed on an Entity Page
Openpackages/app/src/components/catalog/EntityPage.tsx (or your custom entity page) and add:
AdviceCard now appears alongside other overview cards.
6. Style with InfoCard
Swap the<div> for Backstage’s InfoCard for a polished look:


7. Fetch Live Advice
Integrate Backstage’s API abstraction usinguseApi and fetchApiRef:
The Advice Slip API may cache responses. To force fresh data on each request, consider appending a timestamp query (e.g.
?timestamp=${Date.now()}).
8. Run the Plugin Independently
You can develop the plugin without running the entire Backstage app:
Conclusion
You have successfully:- Scaffolded a Backstage frontend plugin
- Exposed both a full-page route and a reusable card extension
- Styled the component with
InfoCard - Fetched live data using
useApiandfetchApiRef - Embedded the card on an entity overview page
- Ran the plugin independently in development mode
Links and References
- Backstage Plugin Development
- Advice Slip API Documentation
- Backstage Core Components
- Material-UI Cards
- Backstage API References