Reference · React

useTechne()

Next release: this page describes techne-sdk/types, which is not in techne-sdk 0.3.4 yet. With techne-sdk 0.3 today shows the released API.

React hooktechne-sdk/reacttechne-sdk/auth/react

The client of the nearest TechneProvider. It is the same techne that connect answers.

Under a provider with clientId it is the signed-in person's client, or the anonymous one until someone signs in. Without a provider above it, it throws.

Returns Techne

NameTypeWhat it is
didstringThe person's DID. The anonymous client's is empty.
query(q, opts?)Promise<Page>One page of a query. techne.query
get(uri, opts?)Promise<Item | null>One record. techne.get
versions(uri)Promise<Versions | null>A record as its versions. techne.versions
put(records, { wait }?)Promise<PutResult>The one write. On the anonymous client it rejects and asks you to sign in. techne.put
queryOptions · getOptions · versionsOptions{ queryKey, queryFn }The three reads for TanStack Query or another data library. Options forms

The hooks read with your app's QueryClient when a QueryClientProvider is above them. With none they use one default client the SDK keeps, defaultQueryClient().

A write from a button
The client you would otherwise hold

connect answers the same client.

The read hooks over it are useRecordQuery, useRecord and useVersions →