# CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager

- Module: `CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager`
- Version: `13.5.0`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/4ff8268fbd97ddd23cb73dc8eff9cc92718156d1)
- Functions: `20`
- Types: `2`

## Types

- [BitwardenSecretManagerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretmanagerresource.md) -- `handle` - 13 members -- Represents a Bitwarden Secrets Manager project and secret graph.
- [BitwardenSecretResource](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/bitwardensecretresource.md) -- `handle` - 1 members -- Represents a Bitwarden secret resource.

## Functions

- [addBitwardenSecretManager](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/addbitwardensecretmanager.md) -- `method` -- Adds a Bitwarden Secrets Manager resource. The `projectNameOrId` parameter resolves to either a project name (creates or finds by name) or a project identifier GUID (adopts the existing project by ID).
- [addSecret](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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}`.
- [addSecretWithRemoteName](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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}`.
- [asSecretId](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/assecretid.md) -- `method` -- Returns an `IExpressionValue` that resolves to the Bitwarden secret identifier. Pass it to `WithEnvironment` to inject the secret ID as an environment variable. The app then uses the Bitwarden SDK to fetch the secret value at runtime.
- [getSecret](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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.
- [getSecretById](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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.
- [getSecretWithRemoteName](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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.
- [withApiUrl](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurl.md) -- `method` -- Overrides the Bitwarden API URL.
- [withApiUrlFromExternalService](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurlfromexternalservice.md) -- `method` -- Overrides the Bitwarden API URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
- [withApiUrlFromParameter](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurlfromparameter.md) -- `method` -- Overrides the Bitwarden API URL using a parameter.
- [withAuthCacheDirectory](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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``1`.
- [withBitwardenReferenceAccessToken](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceaccesstoken.md) -- `method` -- Overrides the Bitwarden access token injected into the connection for `source`. By default the management token is used. Supply a least-privilege read-only token here.
- [withBitwardenReferenceAuthCacheDirectory](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachedirectory.md) -- `method` -- Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, for the connection associated with `source`.
- [withBitwardenReferenceAuthCacheDirectoryFromParameter](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachedirectoryfromparameter.md) -- `method` -- Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, using a parameter, for the connection associated with `source`.
- [withBitwardenReferenceAuthCacheVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachevolume.md) -- `method` -- Mounts a named volume and configures the Bitwarden SDK to store its auth cache there, for the connection associated with `source`. Use this for container resources. For process resources or when the container path is already known, use `WithBitwardenAuthCacheDirectory``1` instead.
- [withBitwardenSecretManagerReference](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardensecretmanagerreference.md) -- `method` -- Injects structured Bitwarden client configuration into the destination resource.
- [withCacheFile](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/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.
- [withIdentityUrl](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurl.md) -- `method` -- Overrides the Bitwarden identity URL.
- [withIdentityUrlFromExternalService](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurlfromexternalservice.md) -- `method` -- Overrides the Bitwarden identity URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
- [withIdentityUrlFromParameter](/reference/api/typescript/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurlfromparameter.md) -- `method` -- Overrides the Bitwarden identity URL using a parameter.
