Authenticates with SELMA and stores the connection for the session.
Once connected, all selma_*() fetch functions use this connection
automatically — no need to pass it explicitly.
Value
A selma_connection object (invisibly). The connection is also
stored in the package environment for automatic use by all fetch functions.
Details
Credentials are resolved in order:
Direct arguments —
base_url,email,passwordconfig.yml — via the config package (
selmakey; see below)Environment variables —
SELMA_BASE_URL,SELMA_EMAIL,SELMA_PASSWORD
Examples
if (FALSE) { # \dontrun{
# Connect once — all functions use it automatically
selma_connect()
students <- selma_students()
enrolments <- selma_enrolments()
# Or pass credentials directly
selma_connect(
base_url = "https://myorg.selma.co.nz/",
email = "api@selma.co.nz",
password = "secret"
)
} # }
