Package 'vvbitwarden'

Title: Interacts with 'Bitwarden Secrets Manager'
Description: Provides functions to securely retrieve secrets from a 'Bitwarden Secrets Manager' vault using the 'Bitwarden CLI', enabling secret and configuration management within R packages and workflows. For more information visit <https://bitwarden.com/products/secrets-manager/>.
Authors: Hajo Bons [aut, cre], Tomer Iwan [aut]
Maintainer: Hajo Bons <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-12 05:25:13 UTC
Source: https://github.com/cran/vvbitwarden

Help Index


Retrieve BWS Access Token from Environment

Description

Retrieves the BWS_ACCESS_TOKEN from environment variables. This token is used to authenticate with the Bitwarden Secrets Manager API.

Usage

get_bws_access_token()

Value

A character string containing the BWS access token.


Get a secret from your Bitwarden Secrets Manager vault

Description

This function retrieves the value of a secret stored in your Bitwarden Secrets Manager vault using the specified key.

Usage

get_bws_secret(
  key,
  bws_access_token = get_bws_access_token(),
  bws_server_url = get_bws_server_url()
)

Arguments

key

A character string representing the key of the secret.

bws_access_token

Optional. A character string representing the Bitwarden access token. Defaults to the value of the "BITWARDEN_ACCESS_TOKEN" environment variable.

bws_server_url

Optional. A character string representing the Bitwarden server URL. Defaults to the value of the "BWS_SERVER_URL" environment variable. For example "https://vault.bitwarden.eu".

Value

A character string containing the value of the secret.

Examples

## Not run: 
# Set environment variables for testing (example values)
Sys.setenv(BWS_ACCESS_TOKEN = "your_access_token_here")
Sys.setenv(BWS_SERVER_URL = "https://vault.bitwarden.eu")

# Retrieve a secret using a key (the key must exist in your vault)
my_secret <- get_bws_secret("my-secret-key")
print(my_secret)

## End(Not run)

Retrieve BWS Server URL from Environment

Description

Retrieves the BWS_SERVER_URL from environment variables. This URL is used to define the Bitwarden Secrets Manager server endpoint.

Usage

get_bws_server_url()

Value

A character string containing the BWS server URL.