API

This document describes the current API surface of this repository at a practical level.

The repository exposes an SSB-style RPC surface through the server created in index.js, the database implementation in lib/db.js, and the loaded plugins wired by bin.js.

For a complete, generated listing of every built-in method with its RPC type, see docs/api-reference.md. That reference is generated from the server's static plugin manifests, so it covers the full built-in surface — the root database plus every RPC-bearing built-in plugin. It deliberately excludes two things: dynamically installed user plugins (loaded by ssb-plugins at runtime), and non-manifest secret-stack core methods (such as auth, address, and multiserver) that a live server adds but does not declare in a manifest. This page covers the same surface at a more practical, hand-written level.

Core message APIs

These are the main methods used to read and write message data.

Writing

Reading

Blob APIs

Blob APIs support content-addressed file storage.

Common blob operations include:

These surfaces are available through the blobs plugin stack and are also exposed over HTTP routes by plugins/decent-ui.js.

Social graph APIs

The friends plugin provides current graph-oriented behavior such as:

These APIs are used to support both social behavior and replication decisions.

Invite APIs

The invite plugin provides:

In this repo, invite behavior should be understood from the current implementation in plugins/invite/index.js, not just from historical scuttlebot wording.

The implementation supports practical behavior such as:

Gossip and replication-related APIs

The repo exposes peer and replication-related behavior through current plugin surfaces such as:

These methods are part of the live behavior of the running node and should be documented according to what the current implementation does.

Browser-facing/API-adjacent access

This repo also supports browser-facing usage through Decent.

Important practical pieces:

This matters because current users may interact with the API surface through the browser UI, not only through Node clients.

HTTP-adjacent surfaces

While the main RPC surface remains SSB-style, the running server also exposes HTTP routes for related functionality:

These are part of the effective public surface of the repo even when they are not traditional RPC methods.

Current documentation rule

The API docs for this repository should describe:

They should not force readers to learn historical storage/index internals in order to understand how the current repository behaves.

What not to center

Unless intentionally promoted back into first-class supported use, legacy indexing-oriented interfaces should not be the center of the API docs.

The main API documentation should instead emphasize the methods backed by the current implementation and current intended workflows.

query.read is not backed by an index

sbot.query.read (the legacy ssb-query / jitdb surface) is registered only as a compatibility stub in this repo and returns an explicit unsupported error. Do not rely on it for reading messages. Use the methods backed by SQLite instead:

Next expansion

This page should be expanded with: