get_username: get or set sciencebase username

View source: R/authenticate_sb.R

get_usernameR Documentation

get or set sciencebase username

Description

Used to retrieve the current user name. Will request the username be entered if no user is provided and 'interactive()' is TRUE.

This is largely an internal function, but is exported for awareness and use in automated pipelines.

Usage

get_username(username = NULL)

Arguments

username

character if NULL, will be retrieved from the 'sb_user' environment variable or the 'username' file stored at 'token_stache_path()'

Value

character string containing a username. Throws an error if no username is found and 'interactive()' is FALSE


USGS-R/sbtools documentation built on June 10, 2025, 12:52 p.m.