# CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager

- Module: `CommunityToolkit.Aspire.Hosting.Bitwarden.SecretManager`
- Version: `13.6.1`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)
- Functions: `20`
- Types: `2`

## Handles

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

## Functions

- [AddSecret](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/addsecret.md) -- `method` - on `BitwardenSecretManagerResource` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/addsecretwithremotename.md) -- `method` - on `BitwardenSecretManagerResource` -- Adds a managed Bitwarden secret with distinct Aspire and remote names. The secret value is resolved from configuration key `Parameters:{parentName}-{name}`.
- [GetSecret](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/getsecret.md) -- `method` - on `BitwardenSecretManagerResource` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/getsecretbyid.md) -- `method` - on `BitwardenSecretManagerResource` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/getsecretwithremotename.md) -- `method` - on `BitwardenSecretManagerResource` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurl.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden API URL.
- [WithApiUrlFromExternalService](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurlfromexternalservice.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden API URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
- [WithApiUrlFromParameter](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withapiurlfromparameter.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden API URL using a parameter.
- [WithAuthCacheDirectory](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withauthcachedirectory.md) -- `method` - on `BitwardenSecretManagerResource` -- 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`.
- [WithCacheFile](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withcachefile.md) -- `method` - on `BitwardenSecretManagerResource` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurl.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden identity URL.
- [WithIdentityUrlFromExternalService](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurlfromexternalservice.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden identity URL using an external service resource. The Bitwarden resource will wait for the external service before authenticating.
- [WithIdentityUrlFromParameter](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withidentityurlfromparameter.md) -- `method` - on `BitwardenSecretManagerResource` -- Overrides the Bitwarden identity URL using a parameter.
- [AsSecretId](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/assecretid.md) -- `method` - on `BitwardenSecretResource` -- 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.
- [AddBitwardenSecretManager](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/addbitwardensecretmanager.md) -- `method` - on `DistributedApplicationBuilder` -- 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).
- [WithBitwardenReferenceAccessToken](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceaccesstoken.md) -- `method` - on `ResourceWithEnvironment` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachedirectory.md) -- `method` - on `ResourceWithEnvironment` -- Configures the directory where the Bitwarden SDK stores its auth cache inside the resource, for the connection associated with `source`.
- [WithBitwardenReferenceAuthCacheDirectoryFromParameter](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachedirectoryfromparameter.md) -- `method` - on `ResourceWithEnvironment` -- 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/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardenreferenceauthcachevolume.md) -- `method` - on `ResourceWithEnvironment` -- 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` instead.
- [WithBitwardenSecretManagerReference](/reference/api/go/communitytoolkit.aspire.hosting.bitwarden.secretmanager/withbitwardensecretmanagerreference.md) -- `method` - on `ResourceWithEnvironment` -- Injects structured Bitwarden client configuration into the destination resource.
