Skip to contents

Store and retrieve keys securely using the system keyring. Typically used for storing OAuth tokens and credentials for the meetupr package.

Usage

meetup_key_set(
  key,
  value,
  client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr")
)

meetup_key_get(
  key,
  client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr"),
  error = TRUE
)

meetup_key_delete(
  key,
  client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr")
)

Arguments

key

Character string indicating the key name to store/retrieve. Default is "token". Valid options are "client_id", "client_secret", "token", and "token_file".

value

Character string with the value to store. If NULL (default), prompts for interactive input.

client_name

A string representing the name of the client. By default, it is set to "meetupr" and retrieved from the MEETUP_CLIENT_NAME environment variable.

error

Logical. If TRUE (default), raises an error when key not found. If FALSE, returns NULL.

Value

  • meetup_key_set(): Returns TRUE invisibly on success

  • meetup_key_get(): Returns the key value, or NULL if not found and error = FALSE

Functions

  • meetup_key_set(): Store a key in the system keyring

  • meetup_key_get(): Retrieve a key from the system keyring

  • meetup_key_delete(): Delete a key in the system keyring

Examples

if (FALSE) { # \dontrun{
meetup_key_set("token", "my-access-token")
meetup_key_set("client_id")

meetup_key_get("token")
meetup_key_get("missing_key", error = FALSE)
} # }