Skip to contents

Use zenodo_pat() to get the token used to authorise Zenodo uploads, or zenodo_pat("your-token") to set it for the rest of the session. The sandbox and the real Zenodo are separate services with separate accounts, so they need separate tokens and are stored separately here.

Usage

zenodo_pat(pat = NULL, sandbox = TRUE)

Arguments

pat

the token to set, or NULL to get the current token

sandbox

whether the token is for the sandbox server

Value

the current token (character; "" when none is set)

Details

To create a token, sign in and go to Applications, then "Personal access tokens", then "New token". Give it a name and tick the deposit:write scope (to create depositions and add files) and deposit:actions (to publish). Copy the token immediately, as Zenodo does not show it again.

The sandbox needs its own account, registered at https://sandbox.zenodo.org; a real zenodo.org login does not work there.

Store them as lines in your .Renviron file (open it with usethis::edit_r_environ()) so they are read every time R starts:

ZENODO_SANDBOX_PAT="replace-with-your-sandbox-token"

ZENODO_PAT="replace-with-your-real-token"

Examples

zenodo_pat() # returns "" unless a token is set
#> [1] ""