Learn R Programming

omophub (version 1.1.0)

get_api_key: Get OMOPHub API Key

Description

Retrieves the OMOPHub API key from multiple sources in priority order:

  1. Explicit argument

  2. OMOPHUB_API_KEY environment variable

  3. System keyring (if keyring package is installed)

Usage

get_api_key(key = NULL)

Value

A character string containing the API key.

Arguments

key

Optional explicit API key. If provided, this takes precedence.

Examples

Run this code
if (FALSE) {
# From environment variable
Sys.setenv(OMOPHUB_API_KEY = "your_api_key")
key <- get_api_key()

# Explicit key
key <- get_api_key("your_api_key")
}

Run the code above in your browser using DataLab