Skip to contents

Set the KoboToolbox server URL, API token and return invisibly a kobo_settings object.

Usage

kobo_setup(
  url = Sys.getenv("KOBOTOOLBOX_URL", ""),
  token = Sys.getenv("KOBOTOOLBOX_TOKEN", ""),
  page_size = 1000L
)

Arguments

url

character, the base URL of the KoboToolbox server.

token

character, the API token.

page_size

integer, the number of submissions to ask for in each API request. Default to 1000L, the limit of public KoboToolbox servers since KoboToolbox KPI version 2.026.03 (March 2026). Some private servers allow more, and a larger value (e.g., 30000L) then means fewer requests. When the server returns fewer submissions than asked, kobo_data() detects its limit and requests the missing submissions, so a large value never loses data.

Value

A kobo_settings object printing the server URL and the API token.

Examples

if (FALSE) { # \dontrun{
 # Public server (default page_size = 1000)
 kobo_setup(url = "https://kf.kobotoolbox.org/",
            token = "9et1814c285w094f6v9bd629df47a1a0e81x53a0")

 # Private server with higher limit
 kobo_setup(url = "https://myserver.org/",
            token = "9et1814c285w094f6v9bd629df47a1a0e81x53a0",
            page_size = 30000)
 kobo_settings()
} # }