# getOrSetSecret

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

Gets a secret value if it exists, or sets it to the provided value if it does not

## Definition

```typescript
interface IUserSecretsManager {
  // ... omitted for brevity
  getOrSetSecret(
    resourceBuilder: IResource,
    name: string,
    value: string): void
}
```

## Parameters

- `resourceBuilder` ([IResource](/reference/api/typescript/aspire.hosting/iresource.md))
- `name` (`string`)
- `value` (`string`)

## Applies to

- [IUserSecretsManager](/reference/api/typescript/aspire.hosting/iusersecretsmanager.md)
