Skip to main content

at.margin

Overview

at.margin is a web annotation layer built on ATProto that lets users write comments and highlights on any URL on the internet. It includes a browser extension and a web app, and uses ATProto lexicon schemas for annotations, bookmarks, highlights, likes, and replies.

Integration Pattern

Layers' externalTarget and W3C selectors (textQuoteSelector, textPositionSelector, fragmentSelector) are structurally compatible with at.margin's annotation targets. An expression record can set sourceUrl to the same URL an at.margin annotation targets, allowing the appview to discover co-located annotations.

{
"$type": "pub.layers.expression",
"sourceUrl": "https://example.com/article",
"text": "...",
"metadata": { ... }
}

An at.margin annotation targeting the same URL can be correlated by the appview through the shared sourceUrl.

Layers Types Involved

TypeRole
pub.layers.expressionsourceUrl matches the at.margin target URL
pub.layers.defs#externalTargetReferences the same external resource
pub.layers.defs#textQuoteSelectorW3C-compatible text selection
pub.layers.defs#textPositionSelectorW3C-compatible offset selection
pub.layers.defs#fragmentSelectorW3C-compatible fragment selection

Discovery

The appview indexes expression.sourceUrl values. When a user queries for annotations on a given URL, the appview returns both Layers annotations and discovers at.margin annotations targeting the same URL through the firehose.