Skip to main content
Every call runs in a frame: who acts (as), the label it happens under (under), the world it reads (in) and the valid instant (at). A client’s frame methods return a new client in that frame and share the original connection setup. Get refs from api<typeof App>(). The client that runs the call, or the nearest <Bijection> for a hook, supplies the frame. The methods chain: client.in(version).at(instant).

Under a family member

A function declared under: tenant, where tenant is a label.family, takes its member from the caller’s frame. Choose the member on the client:
under narrows what the call may read and commit. It never adds authority: the caller’s grants must clear tenant.of("acme"), or the call refuses Disallowed. The member reference is built from its family path and member key. Two queries run separately may answer from different states. Read them at one version to compare them:
A query reads ctx.frame.version and can return it as a t.version value. A read in an older version still needs the caller’s current grants, and the version must still be readable: within the table’s history, or pinned.

In a branch

client.in(branch) reads and writes a branch: a writable world over a version, made by ctx.branch in a mutation. Only the head is watched live: a watch with in or at answers once, for the world and instant it names. Landing the branch is ctx.land, a grave act inside a mutation; see Branches. In React, nest a framed client for the subtree that works in the branch:

At a valid instant

client.at(instant) reads series and timelines at that instant, as .at(instant) does inside a function. A function reads it as ctx.frame.at, which is null for a call at the present.

Try a call: trial

client.trial(fn, args) runs a query or a mutation in a discarded world on hosted and standalone installations. It answers what the call would have done:
A trial uses the presented credential’s admitted authority and the call’s allow, grants, labels and guards. To preview with delegated authority, present the agent’s bearer. A trial’s answer is labelled by everything it read. A later real call is decided again against the state it then reads. Agent bearers validUntil is the first instant at which time alone could change the answer: a grant’s until, a task’s due, the next boundary of a fact read at the present. A call at the same version whose commit lands before it is decided as the trial was. It is null when nothing time-dependent bounds the answer.