> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# WebAssemblyHostBuilder

> Extension methods for WebAssemblyHostBuilder from Microsoft.AspNetCore.Components.WebAssembly

## Definition

**Assembly:** Microsoft.AspNetCore.Components.WebAssembly.dll

**Namespace:** Microsoft.AspNetCore.Components.WebAssembly.Hosting

## Syntax

```csharp theme={"dark"}
Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder
```

## Summary

This type is defined in Microsoft.AspNetCore.Components.WebAssembly.

## Remarks

See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.components.webassembly.hosting.webassemblyhostbuilder) for more information about the rest of the API.

## Methods

### &#x20;AddBlazorEssentials Extension

> [!NOTE]
>
> Extension method from `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilderExtensions`

Registers the necessary services to bootstrap BlazorEssentials, including a `ConfigurationBase`, [AppStateBase](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase.md), and
[HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)HttpClients\</see> for interacting with both the

#### Syntax

```csharp theme={"dark"}
public static Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder AddBlazorEssentials<TConfiguration, TAppState>(Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder builder, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` | The [WebAssemblyHostBuilder](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder.md) instance to configure. |
| `configSectionName` | `string` | The name of the Configuration node in appsettings.json that specifies BlazorEssentials settings. |

#### Returns

Type: `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder`
The

#### Type Parameters

* `TConfiguration` - The `ConfigurationBase`-derived type to register in the DI container.
* `TAppState` - The [AppStateBase](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase.md)-derived type to register in the DI container.

### &#x20;AddBlazorEssentials Extension

> [!NOTE]
>
> Extension method from `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilderExtensions`

#### Syntax

```csharp theme={"dark"}
public static Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder AddBlazorEssentials<TConfiguration, TAppState, TMessageHandler>(Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder builder, string configSectionName) where TConfiguration : CloudNimble.EasyAF.Configuration.ConfigurationBase where TAppState : CloudNimble.BlazorEssentials.AppStateBase where TMessageHandler : System.Net.Http.DelegatingHandler
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `builder` | `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder` | The [WebAssemblyHostBuilder](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/Microsoft/AspNetCore/Components/WebAssembly/Hosting/WebAssemblyHostBuilder.md) instance to configure. |
| `configSectionName` | `string` | The name of the Configuration node in appsettings.json that specifies BlazorEssentials settings. |

#### Returns

Type: `Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder`

#### Type Parameters

* `TConfiguration` - The `ConfigurationBase`-derived type to register in the DI container.
* `TAppState` - The [AppStateBase](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase.md)-derived type to register in the DI container.
* `TMessageHandler` - The [DelegatingHandler](https://learn.microsoft.com/dotnet/api/system.net.http.delegatinghandler)-derived type to register for the built-in HttpClients. Defaults to `BlazorEssentialsAuthorizationMessageHandler`1\`.

#### Remarks

If your *TMessageHandler* needs a constructor, register it before making this call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.