Metadata Type: LightningTypeBundle
LightningTypeBundle is a metadata type in Salesforce that represents custom Lightning types—used to override the default Salesforce UI for specialized actions such as Agentforce employee actions and embedded components. It enables developers to create fully customized UI components by defining schema, editor, and renderer behaviors programmatically via metadata.
Overview
The LightningTypeBundle metadata type was introduced in API version 64.0 and later. It allows retrieval, deployment, creation, update, and deletion of custom Lightning type bundles through the Metadata API. Each bundle contains configuration files that describe validation logic, UI structure, and rendering behaviors for specialized Lightning interactions :contentReference[oaicite:0]{index=0}.
Key Features
- Declarative definition of custom Lightning UI components
- Includes schema, editor, and renderer configuration
- Supports advanced UI customizations for Agentforce and embedded actions
- Deployable and versionable via Metadata API and CI/CD pipelines
Structure and Components
A LightningTypeBundle typically consists of the following components within a dedicated folder:
- schema.json: Defines the JSON schema used to validate configuration and input parameters
- editor.json: (Optional) Defines custom UI behavior for editing the type in Lightning Experience
- renderer.json: (Optional) Defines custom rendering logic, especially for desktop or embedded contexts
Deployment Considerations
When deploying LightningTypeBundle metadata, administrators and developers should consider:
1. API Version Support
Ensure you are using Metadata API version 64.0 or later, as LightningTypeBundle is unsupported in earlier versions :contentReference[oaicite:1]{index=1}.
2. Dependency Files
Bundles must include the correct schema.json and, if applicable, editor.json and renderer.json files. Incomplete bundles may result in deployment failures.
3. Permissions
Deployment requires Metadata API access and appropriate permissions for Lightning customization and Agentforce configuration.
4. UI Consistency
Validate that the defined schema, editor, and renderer configurations align with intended user experience and UI behavior in Lightning.
Best Practices for Salesforce Administrators
1. Leverage Version Control
Store LightningTypeBundle folders in your version control system to track changes, enable peer review, and facilitate rollbacks.
2. Modular Design
Create individual bundles per custom Lightning type to simplify maintenance and reusability across projects.
3. Sandbox Testing
Deploy and test bundles in sandbox environments to verify schema validation, UI rendering, and Editor/Renderer behavior before production rollout.
4. Document Bundle Purpose
Include README or documentation to describe the purpose, schema definitions, and UI behavior associated with each bundle.
5. Validate JSON Schema
Ensure schema.json includes accurate definitions and constraints to prevent invalid configurations during runtime.
6. Coordinate with UI/UX Teams
Work closely with designers to define editor.json and renderer.json, ensuring the UI matches design specifications.
7. Monitor Runtime Behavior
After deployment, observe UI performance and behavior in Lightning Experience, especially for embedded and desktop contexts.
8. Handle Errors Gracefully
Implement error handling and user messaging within renderer/editor configurations to guide users when encountering invalid states.
9. Periodic Reviews
Review bundles regularly—especially after UI updates or Salesforce releases—to ensure compatibility and relevance.
10. Provide Training
Educate team members on the structure and deployment process of LightningTypeBundle metadata to ensure consistency across deployments.
Conclusion
LightningTypeBundle metadata empowers Salesforce developers to create custom Lightning UI components programmatically, with full control over validation, editing, and rendering behavior. By following version control, modular design, sandbox testing, and strong collaboration practices, teams can build scalable, maintainable, and user-friendly custom Lightning types.