# BlazorHostedExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Blazor](/reference/api/csharp/aspire.hosting.blazor.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Blazor/BlazorHostedExtensions.cs)

Extension methods for configuring a Blazor Web App (hosted model) to proxy service calls and telemetry from its WebAssembly client.

## Definition

```csharp
namespace Aspire.Hosting;

public static class BlazorHostedExtensions
{
    // ...
}
```

## Methods

- [ProxyBlazorService(IResourceBuilder<ProjectResource>, IResourceBuilder<IResourceWithServiceDiscovery>, string)](/reference/api/csharp/aspire.hosting.blazor/blazorhostedextensions/methods.md#proxyblazorservice-iresourcebuilder-projectresource-iresourcebuilder-iresourcewithservicediscovery-string) : `IResourceBuilder<ProjectResource>` `extension` `ats ignored` -- Configures the host to proxy requests from the WebAssembly client to the specified service. The WASM client can reach this service via `/{apiPrefix}/{serviceName}/{path}`. YARP routes and clusters are emitted as environment variables. A `/_blazor/_configuration` response is built so the WASM client gets the proxy URL. This is an explicit opt-in -- `WithReference` makes the service available to the server, while `ProxyBlazorService` additionally makes it available to the WASM client.
- [ProxyBlazorTelemetry(IResourceBuilder<ProjectResource>, string)](/reference/api/csharp/aspire.hosting.blazor/blazorhostedextensions/methods.md#proxyblazortelemetry-iresourcebuilder-projectresource-string) : `IResourceBuilder<ProjectResource>` `extension` `ats ignored` -- Configures the host to proxy OpenTelemetry data from the WebAssembly client to the Aspire dashboard. The WASM client sends OTLP data to `/{otlpPrefix}/{path}` which gets forwarded to the dashboard. Also sets the `OTEL_SERVICE_NAME` in the client configuration so telemetry from the WASM client appears with the correct service name in the dashboard.
