# withEndpointsInEnvironment

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.5.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/e076d8e427cb3afb528dbd605acd74c3aea69f94)

Includes only the specified project endpoint names in environment-variable injection.

## Definition

```typescript
interface ProjectResource {
  // ... omitted for brevity
  withEndpointsInEnvironment(endpointNames: string[]): ProjectResource
}
```

## Parameters

- `endpointNames` (`string[]`)

## Returns

[ProjectResource](/reference/api/typescript/aspire.hosting/projectresource.md) `builder`

## Applies to

- [ProjectResource](/reference/api/typescript/aspire.hosting/projectresource.md)
- [CSharpAppResource](/reference/api/typescript/aspire.hosting/csharpappresource.md)
