# WithBlazorClientApp

- Module: [Aspire.Hosting.Blazor](/reference/api/go/aspire.hosting.blazor.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`
- Defined on: `ProjectResource`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Attaches a Blazor WebAssembly app to the Gateway. The resource name is used as the URL path prefix (e.g., resource "store" → /store/). Service names are derived from WithReference() annotations on the WASM resource. Service references from the WASM app are automatically forwarded to the gateway so the gateway can resolve service endpoints for YARP proxying.

## Remarks

For development and publish prerequisites, see `AddBlazorGateway`.

## Definition

```go
func (ProjectResource) WithBlazorClientApp(
    wasmApp BlazorWasmAppResource,
    options ...*WithBlazorClientAppOptions,
) ProjectResource
```

## Parameters

- `wasmApp` ([`BlazorWasmAppResource`](/reference/api/go/aspire.hosting.blazor/blazorwasmappresource.md)) -- The Blazor WebAssembly app to attach to the gateway.
- `options` (`...*WithBlazorClientAppOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithBlazorClientAppOptions` argument.

- `ApiPrefix` (`*string`) -- The URL path prefix for API proxy routes. Defaults to `"_api"`.
- `OtlpPrefix` (`*string`) -- The URL path prefix for OTLP proxy routes. Defaults to `"_otlp"`.
- `ProxyTelemetry` (`*bool`) -- `true` to expose the OTLP proxy for the client app; otherwise, `false`.

## Returns

`ProjectResource`

Returns a handle; failures surface later via `Err()`.

## Applies to

- `CSharpAppResource`
- `ProjectResource`
