# LogtoResource

- Module: [CommunityToolkit.Aspire.Hosting.Logto](/reference/api/typescript/communitytoolkit.aspire.hosting.logto.md)
- Version: `13.5.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/4ff8268fbd97ddd23cb73dc8eff9cc92718156d1)

Represents a containerized resource specific to Logto that extends the base functionality of container resources by providing additional endpoint and connection string management.

## Definition

```typescript
interface LogtoResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly host: EndpointReferenceExpression;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly uriExpression: ReferenceExpression;
  withAdminEndpoint(url: string): LogtoResource;
  withDatabase(
      postgres: PostgresServerResource,
      databaseName?: string): LogtoResource;
  withDatabaseSeeding(): LogtoResource;
  withDataBindMount(source: string): LogtoResource;
  withDataVolume(name?: string): LogtoResource;
  withDeprecationTracing(): LogtoResource;
  withDisableAdminConsole(disable: boolean): LogtoResource;
  withNodeEnv(env: string): LogtoResource;
  withRedis(redis: RedisResource): LogtoResource;
  withResourcePort(
      port?: number,
      adminPort?: number): LogtoResource;
  withSecretVault(secretVaultKek: string): LogtoResource;
  withSensitiveUsername(sensitiveUsername: boolean): LogtoResource;
  withTrustProxyHeader(trustProxyHeader: boolean): LogtoResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the connection URI expression for the Logto container resource.

## Methods

- [withAdminEndpoint](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withadminendpoint.md) -- `method` -- Configures the specified Logto resource to include an administrative endpoint with the given URL.
    ```typescript
  withAdminEndpoint(url: string): LogtoResource
  ```
- [withDatabase](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdatabase.md) -- `method` -- Configures the Logto resource to connect to the specified PostgreSQL database.
    ```typescript
  withDatabase(postgres: PostgresServerResource, databaseName?: string): LogtoResource
  ```
- [withDatabaseSeeding](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdatabaseseeding.md) -- `method` -- Starts Logto by running the database seed command before the application process.
    ```typescript
  withDatabaseSeeding(): LogtoResource
  ```
- [withDataBindMount](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdatabindmount.md) -- `method` -- Configures the Logto resource to use a data bind mount with the specified source directory.
    ```typescript
  withDataBindMount(source: string): LogtoResource
  ```
- [withDataVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdatavolume.md) -- `method` -- Configures the Logto resource with a data volume, allowing persistent storage.
    ```typescript
  withDataVolume(name?: string): LogtoResource
  ```
- [withDeprecationTracing](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdeprecationtracing.md) -- `method` -- Enables Node.js deprecation tracing for the Logto by setting the NODE_OPTIONS environment variable to '--trace-deprecation'. This allows stack traces to be printed for deprecated API usage.
    ```typescript
  withDeprecationTracing(): LogtoResource
  ```
- [withDisableAdminConsole](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withdisableadminconsole.md) -- `method` -- Configures the Logto resource to disable the Admin Console port.
    ```typescript
  withDisableAdminConsole(disable: boolean): LogtoResource
  ```
- [withNodeEnv](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withnodeenv.md) -- `method` -- Configures the Logto resource to use the specified Node.js environment value by setting the corresponding environment variable.
    ```typescript
  withNodeEnv(env: string): LogtoResource
  ```
- [withRedis](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withredis.md) -- `method` -- Configures the Logto resource to use a specified Redis resource for caching or other functionality.
    ```typescript
  withRedis(redis: RedisResource): LogtoResource
  ```
- [withResourcePort](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withresourceport.md) -- `method` -- Configures HTTP endpoints for the given Logto resource builder with specified port settings.
    ```typescript
  withResourcePort(port?: number, adminPort?: number): LogtoResource
  ```
- [withSecretVault](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withsecretvault.md) -- `method` -- Configures the Logto resource to use a secret vault with the specified key encryption key (KEK).
    ```typescript
  withSecretVault(secretVaultKek: string): LogtoResource
  ```
- [withSensitiveUsername](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withsensitiveusername.md) -- `method` -- Specifies whether the username is case-sensitive.
    ```typescript
  withSensitiveUsername(sensitiveUsername: boolean): LogtoResource
  ```
- [withTrustProxyHeader](/reference/api/typescript/communitytoolkit.aspire.hosting.logto/logtoresource/withtrustproxyheader.md) -- `method` -- Configures the Logto resource to enable or disable the trust proxy header behavior.
    ```typescript
  withTrustProxyHeader(trustProxyHeader: boolean): LogtoResource
  ```
