nettskjema_token2renviron {nettskjemar}R Documentation

Write token to .Renviron

Description

This function will write a token to the .Renviron file with the name you provide.

Usage

nettskjema_token2renviron(
  token,
  token_name = "NETTSKJEMA_API_TOKEN",
  action = c("create", "overwrite", "delete")
)

Arguments

token

character. Token generated in the UiO portal api_user_create

token_name

character. Name to give the token, defaults to 'NETTSKJEMA_API_TOKEN'

action

character. One of three actions: 'create', 'overwrite' or 'delete'. Defaults to 'create'.

Details

Possible actions

Value

No return value. Writes a token to Renviron

Examples

## Not run: 
my_token <- "aoiehtvo09e7h"
nettskjema_token2renviron(my_token)
nettskjema_token2renviron(my_token, action = "overwrite")
nettskjema_token2renviron(my_token, action = "delete")

# Under a custom name
nettskjema_token2renviron(my_token,
                         token_name = "NETTAKJEMA_TOKEN_ALT")

## End(Not run)

[Package nettskjemar version 0.1.4 Index]