How to handle the API key in public and private codes.

library(fwtraits)

Steps in securing the API key.

Test if the API key is well saved



migration <- fw_fetchdata(data = 'Abramis brama', 
                         organismgroup = 'fi',
                         ecoparams = 'migration',
                         cachefolder = 'cache', 
                         warn = TRUE,
                         inform = TRUE,
                         details = TRUE)#the species spelling is checked

#or use the fw_keyload() function: which returns a congratulation message

3. References

  1. Wickham H (2024). httr2: Perform HTTP Requests and Process the Responses. R package version 1.0.3,https://CRAN.R-project.org/package=httr2

  2. https://httr2.r-lib.org/articles/wrapping-apis.html