Overleaf's git bridge authenticates with a personal token rather than your Overleaf password. Generate one at https://www.overleaf.com/user/settings under "Git integration", then call this function to store it.

set_overleaf_token(token = NULL, save = NULL)

Arguments

token

Your Overleaf git authentication token. If NULL (the default) you will be prompted for it, so that the token isn't recorded in your console history or your script.

save

Logical. Should the token be saved to your user .Renviron file, so it is available in every future R session on this computer? If NULL (the default) you will be asked.

Value

The token, invisibly.

Details

A single token works for every Overleaf project you can open, so this is a one-off setup step per computer. Tokens expire after a year, and you can have at most ten at a time.

Saving writes OVERLEAF_TOKEN to the .Renviron file in your home directory. Note that if your working directory contains its own .Renviron, R reads that file instead of the one in your home directory, so the token won't be picked up; you'll be warned if that's the case.

Examples

if (FALSE) { # \dontrun{
# Prompts for the token and offers to save it
set_overleaf_token()
} # }