Skip to contents

This function verifies whether the required system variables (`NETTSKJEMA_CLIENT_ID` and `NETTSKJEMA_CLIENT_SECRET`) are set to enable authentication with the Nettskjema API. It provides feedback on the setup status and returns whether the system is correctly configured.

Usage

ns_has_auth(
  client_id = Sys.getenv("NETTSKJEMA_CLIENT_ID"),
  client_secret = Sys.getenv("NETTSKJEMA_CLIENT_SECRET")
)

Arguments

client_id

[character] The client ID provided by Nettskjema.

client_secret

[character] The client secret provided by Nettskjema.

Value

Logical. Returns `TRUE` if both environment variables are set, otherwise `FALSE`.

References

For more information about authentication setup, see: https://www.capro.dev/nettskjemar/articles/authentication.html

Examples

ns_has_auth()
#> [1] FALSE