Entity Scaffolder Content Frontend Plugin#
Overview#
The Entity Scaffolder Content frontend plugin enhances Backstage's scaffolder functionality by allowing you to embed template selection and execution directly within entity pages. This integration provides a more contextual and streamlined experience for users working with templates.
Features#
Template Integration#
- Embed scaffolder templates in entity pages
- Add dedicated template tabs to entity layouts
- Seamless integration with existing entity pages
Context-Aware Filtering#
- Filter templates based on entity metadata
- Custom filter rules and conditions
- Group templates by categories
- Dynamic template visibility
Data Pre-population#
- Auto-fill template forms with entity data
- Dynamic value mapping
- Custom data transformation
- Context-aware defaults
Form Decorator Support#
- Backstage form decorators declared in a template's
spec.formDecoratorsare executed automatically before the scaffold call - Enables use-cases such as fetching an OAuth token (e.g. GitHub) to avoid self-approval of PRs
- Register decorators via
FormDecoratorBlueprint(new frontend system) — no changes toEntityScaffolderContentrequired
Automatic Field Extension Discovery#
- In the new Backstage frontend system, all
FormFieldBlueprintextensions are discovered automatically viaformFieldsApiRef— no need to pass aScaffolderFieldExtensionsnode manually - The
ScaffolderFieldExtensionsprop is still supported for explicit / legacy extensions
Task Progress Display#
- After a template is submitted, an inline task progress view is shown
- Displays per-step status and completion indicators
- Streams live task logs
- Shows template output links/values on completion
User Interface#
- Clean and intuitive template browsing
- Consistent Backstage design language
- Responsive layout
- Integrated form handling
Components#
EntityScaffolderContent#
The main component that provides:
- Template listing and filtering
- Integration with entity context
- Template form rendering with field extensions
- Form decorator execution
- Data pre-population logic
- Task progress, logs, and outputs display
Example usage:
<EntityScaffolderContent
templateGroupFilters={[
{
title: 'Crossplane Claims',
filter: (entity, template) =>
template.metadata?.labels?.forEntity === 'system' &&
entity.spec?.type === 'kubernetes-namespace',
},
]}
buildInitialState={(entity, template) => ({
xrNamespace: entity.metadata.name,
clusters: [entity.metadata?.annotations?.['backstage.io/managed-by-location']?.split(': ')[1] ?? '']
})}
/>
Template Filters#
Configure how templates are filtered and grouped:
- Define filter conditions using entity and template data
- Group templates by purpose
- Apply entity-specific rules
- Handle template metadata
Initial State Builder#
Customise how entity data maps to template fields:
- Transform entity metadata
- Set default values
- Handle complex data structures
- Apply business logic
Technical Details#
Integration Points#
- Backstage Scaffolder (native
scaffolderApiRef) - Backstage
formDecoratorsApiRef(form decorator execution) - Backstage
formFieldsApiRef(automatic field extension discovery) - Entity Catalog
- Template Engine
Component Props#
EntityScaffolderContent#
| Prop | Type | Required | Description |
|---|---|---|---|
templateGroupFilters |
Array<{ title?: ReactNode; filter: (entity, template) => boolean }> |
Yes | Defines template filtering and visual grouping |
buildInitialState |
(entity: Entity, template: Template) => Record<string, JsonValue> |
Yes | Maps entity data to template form fields |
ScaffolderFieldExtensions |
ReactNode |
No | Explicit field extensions (optional — extensions are auto-discovered in the new frontend system) |
layouts |
LayoutOptions[] |
No | Custom layout options for the workflow stepper |
components.TemplateCard |
ComponentType<{ template: TemplateEntityV1beta3 }> |
No | Custom component to render each template card |
User Experience#
Template Discovery#
- Navigate to an entity page
- Access the templates tab
- View filtered, relevant templates
- Select appropriate template
Template Usage#
- Choose a template
- Review pre-populated data
- Fill remaining fields
- Submit — form decorators run automatically before submission
- Watch inline task progress, live logs, and outputs
Template Filtering#
- Templates filtered automatically
- Grouped by configured categories
- Only relevant templates shown
- Entity context considered