Builds a harbour_client object that holds the server URL, the user's
credentials and a lazily-fetched, transparently-refreshed base token.
The client is environment-backed, so internal token refreshes mutate
cached state in place without reassigning your variable.
Usage
hb_client(
server = Sys.getenv("SEATABLE_SERVER"),
api_token = Sys.getenv("SEATABLE_API_TOKEN"),
...,
username = NULL,
password = NULL,
base_uuid = NULL,
workspace_id = NULL,
base_name = NULL,
timeout = 30
)
# S3 method for class 'harbour_client'
print(x, ...)
# S3 method for class 'harbour_client'
format(x, ...)Arguments
- server
URL of the SeaTable server, e.g.
"https://seatable.example.org". Defaults to theSEATABLE_SERVERenvironment variable.- api_token
Long-lived per-base API token. Defaults to the
SEATABLE_API_TOKENenv var. Mutually exclusive withusername/password.- ...
Unused.
- username, password
Account credentials. Used to acquire an account token. Mutually exclusive with
api_token.- base_uuid
Optional base UUID hint; usually discovered from the base-token exchange.
- workspace_id, base_name
Which base to work on. Required for a
username/passwordclient, because an account token is scoped to the user rather than to a base. Ignored whenapi_tokenis used, since an API token names its base implicitly.- timeout
Per-request timeout in seconds. Default
30.- x
A
harbour_client.
Details
SeaTable uses a three-token model. hb_client() accepts either an
API token (per-base, long-lived, generated in the SeaTable UI) or
username + password (which yields an account token). In-base calls
transparently exchange these for a short-lived base token.
Defaults for server and api_token are read from the environment
variables SEATABLE_SERVER and SEATABLE_API_TOKEN.
See also
Other client:
hb_check_credentials(),
hb_ping(),
hb_server_info(),
is_harbour_client()
Examples
if (FALSE) { # interactive()
client <- hb_client(
server = Sys.getenv("SEATABLE_SERVER"),
api_token = Sys.getenv("SEATABLE_API_TOKEN")
)
print(client)
}