# AddLogto

- Module: [CommunityToolkit.Aspire.Hosting.Logto](/reference/api/go/communitytoolkit.aspire.hosting.logto.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds a Logto resource to the Aspire distributed application by configuring it with the specified name, associated PostgreSQL server resource, and database name.

## Definition

```go
func (DistributedApplicationBuilder) AddLogto(
    name string,
    postgres PostgresServerResource,
    options ...*AddLogtoOptions,
) LogtoResource
```

## Parameters

- `name` (`string`) -- The name of the Logto resource.
- `postgres` ([`PostgresServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.logto/postgresserverresource.md)) -- The resource builder for the PostgreSQL server that the Logto will connect to.
- `options` (`...*AddLogtoOptions`) -- optional settings, see [Options](#options)

## Options

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

- `DatabaseName` (`*string`) -- The PostgreSQL database name Logto should use.
- `Port` (`*float64`) -- The host port to be configured for the primary endpoint. If `null`, Aspire will assign a random host port.
- `AdminPort` (`*float64`) -- The host port to be configured for the administrative endpoint. If `null`, Aspire will assign a random host port.

## Returns

[`LogtoResource`](/reference/api/go/communitytoolkit.aspire.hosting.logto/logtoresource.md) -- The resource builder configured for the added Logto resource.

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

## Applies to

- `DistributedApplicationBuilder`
