get_api_key: Get OMOPHub API Key

View source: R/auth.R

get_api_keyR Documentation

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)

Arguments

key

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

Value

A character string containing the API key.

Examples

## Not run: 
# From environment variable
Sys.setenv(OMOPHUB_API_KEY = "your_api_key")
key <- get_api_key()

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

## End(Not run)

omophub documentation built on Dec. 17, 2025, 5:10 p.m.