ors_api_key: API key management

ors_api_keyR Documentation

API key management

Description

Get/set openrouteservice API key.

Usage

ors_api_key(key, service = "openrouteservice", username = NULL, keyring = NULL)

Arguments

key

API key value provided as a character scalar

service

Service name, a character scalar.

username

Username, a character scalar, or NULL if the key is not associated with a username.

keyring

For systems that support multiple keyrings, specify the name of the keyring to use here. If NULL, then the default keyring is used. See also has_keyring_support().

Details

To set the key provide it in the key argument. To retrieve the current value call the function with key unset.

Typically the key is saved in the system credential store. Once the key is defined, it persists in the keyring store of the operating system so it doesn't need to be set again in a new R session.

Internally the function uses ⁠\link[keyring]{key_set}⁠ and ⁠\link[keyring]{key_get}⁠. The use of keyring package can be bypassed by providing the key in the environment variable ORS_API_KEY. The value from the environment variable takes precedence over the value stored in the system credential store. The default environment variable name used to retrieve the openrouteservice api key can be overridden by specifying it in options("openrouteservice.api_key_env").

Value

API Key value when called without key.

Author(s)

Andrzej Oleś andrzej.oles@gmail.com


openrouteservice documentation built on Oct. 21, 2024, 9:06 a.m.