tf_test_) while you build. Never paste a live key into a
page, a ticket or a chat.
Create a client
baseUrl defaults to the production API. credential is an organization key, a teammate
token, or a function that returns one (for a key you load from a secret store). Keep
organization keys on your servers.
Typed calls
Each method takes a path from the API reference and is typed from it: path parameters, query parameters, the body and the answer.Pagination
paginate follows next_cursor for every list that has one and yields each item.
Send events
tf.events.send checks every event before it sends anything, gives each event that needs
one an idempotency key, and splits a long list into requests within the API’s limits. The
builders are on Observation builders.
Errors
Every error answer becomes an error class named for its code, and every one extendsTechnicallyFitError with code, message, status, requestId and
details. A code this version does not know is a plain TechnicallyFitError.
Retries and rate limits
The client sends a request again after a429, and after a network failure, 500, 502,
503 or 504 when sending it again cannot change the outcome (reads, updates, and the
event endpoints, whose events carry their own keys). It waits the Retry-After the API
sent, or until the rate-limit window resets, or backs off with jitter. It never retries
another 4xx.
Retry-After longer than maxRetryAfterSeconds (60 by default) is not waited out: the
call throws RateLimitError with retryAfterSeconds, so you can schedule the work.
Page through events
Usepaginate to walk through paged endpoints such as GET /v1/events until next_cursor is null:
Sign a teammate in from a member app
A member app holds a teammate token, never an organization key. The SDK runs the sign-in flow and gives you a credential that refreshes itself. The issuer is the authorization server you configure.TeammateSignedOutError: send the person back to sign-in.