get_neon_api_token: Check to see if a NEON api token is installed

View source: R/get_neon_api_token.R

get_neon_api_tokenR Documentation

Check to see if a NEON api token is installed

Description

This function checks if a NEON API token exists in your .Renviron file so it can be called securely without being stored in your code.

Usage

get_neon_api_token(token = NULL)

Arguments

token

The API token provided to you from the NEON formatted in quotes. A key can be acquired at https://www.neonscience.org/resources/learning-hub/tutorials/api-token-setup. If an input string is specified then the function will return it as output.

See Also

[neon_api_token()]

Examples

# Supply a token directly - what will be returned is the input.
get_neon_api_token("example_token")

# Or retrieve NEON stored in the environment
if (nzchar(Sys.getenv("NEON_TOKEN"))) {
  get_neon_api_token()
}

neonSoilFlux documentation built on July 3, 2026, 5:07 p.m.