-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make the API key setting user-friendlier #51
Comments
This sets the API key only for the current session, or am I missing something? |
No since it uses |
Yeah that's what I thought. For some reason I had the impression that this would set the key permanently when I glanced at it the first time. Don't really know why, though. |
I'm still torn between documenting it or making it even easier 😂 |
Just leaving this here as a note: One possible solution would be to |
So your first idea would mean restarting once per session? For further ref link to keyring https://github.com/r-lib/keyring |
I meant something like this: oc_configure <-
function(
key = NULL,
max_rate_per_sec =
getOption("oc_max_rate_per_sec", default = 1L),
...
) {
if (!is.null(key)) {
Sys.setenv("OPENCAGE_KEY" = key)
}
ratelimitr::UPDATE_RATE(
oc_get_limited,
ratelimitr::rate(n = max_rate_per_sec, period = 1L)
)
} Probably needs a I like Bob's take on oc_configure(key = keyring::key_get("opencage")) instead of providing the key with every call like this: oc_forward("something,something", key = keyring::key_get("opencage")) |
Or we could more simply message about |
You seem to be torn, indeed. 😉 |
FWIW, openrouteservice-r is (planning on) moving away from keyring to |
Ah that's interesting! But I thought that keyring also supported |
Yep, indeed! |
mostly stealing all ideas from https://github.com/hrbrmstr/omdbapi/blob/3b69849a540c844a09cf03fb4005b1fd16f80eb2/R/omdb_api_key.R
The text was updated successfully, but these errors were encountered: