Configuration
Learn how to configure Umbraco UI Builder in your project using two different approaches.
You can configure Umbraco UI Builder either via a Composer or in the Program.cs.
Option 1: Configuring via a Composer
A Composer is a common approach for registering and configuring services in Umbraco during application startup.
To configure Umbraco UI Builder via a Composer:
Create a file called
UIBuilderComposer.csin your project.Implement the
IComposerinterface and add the configuration inside theComposemethod:
using Umbraco.Cms.Core.Composing;
using Umbraco.UIBuilder.Extensions;
public class UIBuilderComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.AddUIBuilder(cfg =>
{
// Apply your configuration here
});
}
}Option 2: Configuring via Program.cs
Program.csYou can also configure Umbraco UI Builder directly in Program.cs using the AddUIBuilder extension method.
To configure Umbraco UI Builder:
Open the
Program.csfile in your project.Locate the
CreateUmbracoBuilder()method.Add
AddUIBuilderbeforeAddComposers().
builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
.AddUIBuilder(cfg => {
// Apply your configuration here
})
.AddDeliveryApi()
.AddComposers()
.Build();Example Configuration
For a complete sample configuration, see the Creating your First Integration article.
The AddUIBuilder method accepts a delegate function, allowing you to configure your solution using fluent APIs.
Last updated
Was this helpful?