Skip to content

What is an adapter?

An adapter is trusted code that an installation includes in its API or reader build. Register one when a source needs its own parser, page comparison, library record or reading view.

To add Where the adapter plugs in
A structured newsletter The API declares a subtype. The verified inbound webhook queues mail for its matched feed. The adapter supplies a worker to claim and process that mail. The reader can register a creation dialog and a view for the same subtype.
A deterministic crawler The first handler that matches the URL supplies a schema, a snapshot and change-report HTML. The shared crawler compares snapshots and handles scheduling, history and publication.
A library collection for agents The API adds a named MCP record kind, a fixed set of returned fields, read scopes and parent ownership checks. A searchable collection also supplies the indexed text expressions.
API operations The adapter mounts routes under /api/content or /api/stories and attaches the appropriate user or cron middleware to each route.
Editorial defaults API contributions include prompts, ticker defaults, a legacy recap definition, article-matching recap rules and a section that can supply report photos. Reader contributions include ticker defaults, legacy recap controls and newsletter catalog and prompt metadata.

Import API contributions in api/src/adapters/registered.ts and reader contributions in src/adapters/registered.ts. Each module exports an array named adapters. A crawler can be API-only. A newsletter with a custom view uses the same stable subtype on both sides.

An adapter executes with its host process’s privileges. Review its imports, routes, SQL and rendering before adding it to a build. Derive identity from the authenticated context, verify ownership of parent records, and treat mail, links and page content as untrusted input.

Both arrays can be empty. Core sources, ordinary newsletter articles, configured crawler providers, library records and standard recaps remain available. MCP advertises ordinary newsletter creation with a title and optional category. Adding a newsletter adapter makes its subtype selectable. Removing its registration leaves the saved feed and data in place.

Build the classifieds newsletter example or look up a field in the adapter interface reference.