Skip to contents

Sets the personal access token used for requests in this session. With a token, 'Discogs' allows 60 requests a minute instead of 25, dig_collection() and dig_wantlist() can read your own collection and wantlist when they are private, and dig_search(), dig_price_suggestions() and dig_collection_value() work. A token can be generated at https://www.discogs.com/settings/developers.

Usage

dig_auth(token = Sys.getenv("DISCOGS_TOKEN"))

Arguments

token

A personal access token. By default the value of the DISCOGS_TOKEN environment variable. An empty string removes the token, so requests are made without one. Spaces at either end are removed, and a token with spaces or line breaks inside is rejected.

Value

TRUE if a token is set and FALSE otherwise, invisibly.

Details

If dig_auth() is never called, the DISCOGS_TOKEN environment variable is used. Storing the token in .Renviron keeps it out of your scripts.

Examples

if (FALSE) { # interactive()
dig_auth()
}