tests/testthat/helper-vcr.R

if (requireNamespace("vcr", quietly = TRUE)) {
  vcr::vcr_configure(
    dir = "_vcr",
    filter_request_headers = list("X-Api-Key")
  )

  # Set a fake API key for tests so validation passes
  # VCR will intercept HTTP requests and use recorded cassettes
  if (Sys.getenv("PATENTSVIEW_API_KEY") == "") {
    Sys.setenv(PATENTSVIEW_API_KEY = "test-api-key")
  }
}

Try the patentsview package in your browser

Any scripts or data that you put into this service are public.

patentsview documentation built on Feb. 26, 2026, 5:07 p.m.