Reference · SDK

techne.put(records, { wait }?)

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.

methodtechne-sdk/connectIn React, useTechne().put

The one write. Records go to the person's own repo, public or into a space. Nothing refuses a write.

Private records (with a space) are written first, with the platform's batch write. Public ones follow in one applyWrites to the PDS, then a hint so the platform indexes them before the relay does. Keys are derived from the records, so sending the same records again is safe.

Parameters

NameTypeWhat it is
recordsrequiredPutRecord[]The records to write.
options.waitnumberWait up to this many ms for the curated record that names one of these as its source.

Each record

recordrequiredAnyRecordThe body; its $type is its collection. Place.create makes one.
spacestringThe space it is placed in, at://{authority}/{spaceType}/{skey}. A record with a space is private, and a record of a type with no public home must name one: put throws PutError (InvalidRequest) before writing anything when it does not.
rkeystringIts key. Derived when absent.

Returns PutResult

NameTypeWhat it is
writesWritten[]Every record written, private ones first. Each has uri, cid, and on a public one its status.
status{ decision: 'pending' | 'invalid', … }The status of the put as a whole. It is invalid when the platform refused a public record, else pending. It is never valid. To get the curated version, pass wait.
curated{ uri, cid, record }The curated record, if it came in time. Only with wait.
curationCuration[]Each public record's curation. It is pending, curated or notCurated with why.

Throws PutError when the batch write refuses a private record. Then nothing public was written; send the same records again.

A public place, then a private post for one circle
In React

Calls permissioned.putRecords, com.atproto.repo.applyWrites and sync.indexRecord →