Building an app

Find or make a type

Every record has a type. Use one the platform already indexes, publish a community draft, or ask for one from the network.

Types

Three ways to a type:

  1. Use an indexed one. pub.techne.draft.registry.listTypes {q} searches names, fields and purposes (most used first); pub.techne.draft.registry.getType {nsid} gives the lexicon, query roles, creator, state, record count and sidecars. People browse the same list on techne.pub (techne.pub/community.html).
  2. Publish a community draft. pub.techne.draft.registry.publishType {name, lexicon, query}, signed in (an app asks for it with the SDK’s scopes({ publish: true }) and calls it through techne.platform; the answer’s nsid then goes in types for the sign-in that writes it), makes pub.techne.draft.c.<id>.<name> (random id), indexed from then on. Send query (which fields are the start, end, location, text, references, category); without it records can only be got and listed. Only you may change it (publishType again with its nsid, additive changes only); anyone may fork it (forkOf). One publish a minute per account (bursts of 10):
    call("pub.techne.draft.registry.publishType", { name: "toolListing",
      lexicon: { lexicon: 1, defs: { main: { type: "record", key: "tid", record: { type: "object",
        required: ["title", "createdAt"], properties: { title: { type: "string", maxLength: 200 },
        createdAt: { type: "string", format: "datetime" } } } } } },
      query: { lexicon: 1, defs: { main: { type: "queryDocument", roles: { text: "title" } } } } })
  3. Request an existing NSID from the network: pub.techne.draft.registry.requestType {nsid, query}. Its schema must be published (_lexicon TXT record, com.atproto.lexicon.schema record). Build at once: while pending, records written through the platform (SDK put, the door’s com.atproto.repo.applyWrites, or a hint) are indexed under the real name. An operator approves (its existing records on the network are then read in; new network writes follow once a release subscribes to the type) or declines (still written-through only). pub.techne.draft.registry.getTypeRequest {nsid} shows where it stands. Find types we don’t index on Lexicon Garden (lexicon.garden); see who writes one with com.atproto.sync.listReposByCollection {collection} on a relay (bsky.network).

Sidecars

To extend someone else’s type, publish a sidecar (sidecarOf): your own type whose records carry subject (the record extended). “Would this be a field on their record?” means a sidecar; “do people make many?” means its own type. listTypes {sidecarOf} finds a type’s sidecars.

Always share the page

Every registry answer carries page, the type’s techne.pub page. Share it.