Skip to contents

Creates a REDCap project object. Can accept parameters directly or fall back to environment variables if not provided. This is the main function for creating REDCap projects in sardine.

Usage

redcap_project(
  url = NULL,
  token = NULL,
  ssl_verify = TRUE,
  timeout = 30,
  env_prefix = "REDCAP"
)

Arguments

url

Character string. REDCap API URL. If NULL, uses REDCAP_URL environment variable

token

Character string. REDCap API token. If NULL, uses REDCAP_TOKEN environment variable

ssl_verify

Logical. SSL verification (default: TRUE)

timeout

Numeric. Request timeout in seconds (default: 30)

env_prefix

Character string. Environment variable prefix (default: "REDCAP")

Value

A redcap_project object

Examples

if (FALSE) { # \dontrun{
# Direct parameters
project <- redcap_project(
  url = "https://redcap.example.edu/api/",
  token = "your_token_here"
)

# Environment variables (REDCAP_URL and REDCAP_TOKEN)
project <- redcap_project()

# Mix of direct and environment
project <- redcap_project(url = "https://redcap.example.edu/api/")
} # }