# BitwardenSecretManagerResource

- Module: [CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager.md)
- Version: `13.6.1`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Represents a Bitwarden Secrets Manager project and secret graph.

## Definition

```go
type BitwardenSecretManagerResource interface {
    Resource
    ResourceWithWaitSupport
}
```

## Embeds

- `Resource`
- `ResourceWithWaitSupport`

## Methods

- [AddSecret](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/addsecret.md) -- `method` -- Adds a managed Bitwarden secret whose local and remote names are the same. The secret value is resolved from configuration key `Parameters:{parentName}-{name}`.
  ```go
  AddSecret(name string) BitwardenSecretResource
  ```
- [AddSecretWithRemoteName](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/addsecretwithremotename.md) -- `method` -- Adds a managed Bitwarden secret with distinct Aspire and remote names. The secret value is resolved from configuration key `Parameters:{parentName}-{name}`.
  ```go
  AddSecretWithRemoteName(name string, remoteName string) BitwardenSecretResource
  ```
- [GetSecret](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/getsecret.md) -- `method` -- Gets or creates a Bitwarden secret reference whose Aspire and remote names are the same. The secret must already exist in Bitwarden; use `AddSecret` if Aspire should own and write the secret value.
  ```go
  GetSecret(name string) BitwardenSecretResource
  ```
- [GetSecretById](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/getsecretbyid.md) -- `method` -- Gets or creates a Bitwarden secret reference by secret identifier. Use this when multiple secrets share the same name and the identifier is the only unambiguous key. The secret must already exist in Bitwarden; use `AddSecret` if Aspire should own and write the secret value.
  ```go
  GetSecretById(name string, secretId string) BitwardenSecretResource
  ```
- [GetSecretWithRemoteName](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/getsecretwithremotename.md) -- `method` -- Gets or creates a Bitwarden secret reference with distinct Aspire and remote names. The secret must already exist in Bitwarden; use `AddSecret` if Aspire should own and write the secret value.
  ```go
  GetSecretWithRemoteName(name string, remoteName string) BitwardenSecretResource
  ```
- [WithApiUrl](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withapiurl.md) -- `method` -- Overrides the Bitwarden API URL.
  ```go
  WithApiUrl(apiUrl string) BitwardenSecretManagerResource
  ```
- [WithApiUrlFromExternalService](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withapiurlfromexternalservice.md) -- `method` -- Overrides the Bitwarden API URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
  ```go
  WithApiUrlFromExternalService(server ExternalServiceResource) BitwardenSecretManagerResource
  ```
- [WithApiUrlFromParameter](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withapiurlfromparameter.md) -- `method` -- Overrides the Bitwarden API URL using a parameter.
  ```go
  WithApiUrlFromParameter(apiUrl ParameterResource) BitwardenSecretManagerResource
  ```
- [WithAuthCacheDirectory](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withauthcachedirectory.md) -- `method` -- Overrides the AppHost auth cache directory (Bitwarden SDK auth session used by the AppHost reconciler). Defaults to the Aspire store when not set. Override to reuse a cached auth session across CI runs. To configure the auth cache directory inside the deployed app, use `WithBitwardenAuthCacheDirectory`.
  ```go
  WithAuthCacheDirectory(authCacheDirectory string) BitwardenSecretManagerResource
  ```
- [WithCacheFile](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withcachefile.md) -- `method` -- Overrides the AppHost cache file path (integration bookkeeping: Bitwarden project ID, secret ID mappings). Defaults to `.bitwarden/{resourceName}.{environment}.json` relative to the AppHost directory. Override to share the cache across multiple AppHost projects, or to store it in a CI cache directory.
  ```go
  WithCacheFile(cacheFile string) BitwardenSecretManagerResource
  ```
- [WithIdentityUrl](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withidentityurl.md) -- `method` -- Overrides the Bitwarden identity URL.
  ```go
  WithIdentityUrl(identityUrl string) BitwardenSecretManagerResource
  ```
- [WithIdentityUrlFromExternalService](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withidentityurlfromexternalservice.md) -- `method` -- Overrides the Bitwarden identity URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
  ```go
  WithIdentityUrlFromExternalService(server ExternalServiceResource) BitwardenSecretManagerResource
  ```
- [WithIdentityUrlFromParameter](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource/withidentityurlfromparameter.md) -- `method` -- Overrides the Bitwarden identity URL using a parameter.
  ```go
  WithIdentityUrlFromParameter(identityUrl ParameterResource) BitwardenSecretManagerResource
  ```
