# DevTunnelResource.withExpiration

- Module: [Aspire.Hosting.DevTunnels](/reference/api/typescript/aspire.hosting.devtunnels.md)
- Defined on: [DevTunnelResource](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource.md)
- Version: `13.6.0`
- Kind: `method`

Configures how long the tunnel can remain unused or unmodified before it expires.

## Definition

```typescript
interface DevTunnelResource {
  // ... omitted for brevity
  withExpiration(expirationHours: number): DevTunnelResource;
}
```

## Signature

```typescript
withExpiration(expirationHours: number): DevTunnelResource
```

## Parameters

- `expirationHours` (`number`)

## Returns

[DevTunnelResource](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource.md) `builder`

## Defined on

- [DevTunnelResource](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource.md) -- `handle`
