atproto-comments
Published on 🤖 If you want your AI to read this post, download it as markdown.I've just published atproto-comments (on npm and JSR), a web component that brings AT Protocol comments to any website, simply and with no authentication required.
- You publish an article on your website.
- You publish a post on an AT Protocol app (Bluesky, Mu, Deer, etc.) with a link to that article.
- You add the component to your HTML, pointing to the post through its AT URI:
<atproto-comments thread-uri="at://did:plc:xxxx/app.bsky.feed.post/yyyy"></atproto-comments>
And that's it: the replies to that post show up as comments on your article. What's more, if a visitor with an account on an AT Protocol app wants to comment, they pick their app and get redirected to the post.
The goal is twofold. On the one hand, to offer a comment system that's easy to integrate, with no database of your own and no reliance on platforms like Disqus. On the other, to bring to your website the conversations that today stay locked inside social networks.
If you don't know the AT Protocol, keep reading. I'm going to tell you the path I followed until I got to know it and understand it, because I have a hunch it'll be more useful than a textbook definition.
A year and a half ago, fed up with the dumpster fire X has become, I went looking for alternatives. I came across Bluesky, which promised to be an open network and had an interface with old-Twitter vibes. I liked it: almost no noise, no nazis, no bots. But I didn't get why it was "open".
In March I saw a post from Eurosky, an independent European initiative working to build an open social web. They were inviting people to move their Bluesky accounts, hosted on servers in the US, to their servers in Europe, and keep talking on Bluesky. How? That was already a bit stranger. But it was true: I moved my account to Eurosky and kept talking on Bluesky.
In June, another post from Eurosky. This time they were announcing mu.social, a new microblogging app. I tried logging in with my Bluesky credentials and my jaw dropped. There was my profile, with my posts, the people I follow and my followers. Everything. Then I came across Deer and the same thing happened.
Wait, this reminded me of something I'd lived through before. I've got it: RSS, Google Reader, Feedly, the golden age of blogs! Back when the internet was decentralized and what we read and published wasn't warped by the algorithms of private companies.
I did some research and put the pieces together. This was possible because Bluesky is built on the AT Protocol, an open protocol for decentralized social networks. In it, your data lives on a personal data server (PDS) and is cryptographically signed. That's why we can switch providers without losing our account or our followers (the data is ours!), and even run our own server (link to the GitHub repository). We can consume our data, and that of the people we follow, from different apps. And we can build tools like atproto-comments, which I've just published, without depending on whatever a company decides at any given moment.
How it works under the hood
If you want to see the pieces of the puzzle, these are the ones that come into play when atproto-comments loads the comments:
- Identity (DID and handle): every account has a permanent identifier (
did:plc:...) and a human-readable name (@xulio.eurosky.social). The DID is what lets you switch servers without losing anything. - PDS (Personal Data Server): the server where your data lives, in a signed repository. It can be Bluesky's, Eurosky's or your own.
- Lexicons and records: every data type has a public schema. A post is a record in the
app.bsky.feed.postcollection; that's why the AT URI points toat://<did>/app.bsky.feed.post/<id>. - Relay: collects the changes from every PDS and emits them in a single stream (the firehose).
- AppView: consumes that stream, indexes it and serves ready-made views, such as the reply thread of a post. atproto-comments requests that thread from the Bluesky AppView's public API (
app.bsky.feed.getPostThread), but you can point it to another AppView with theappviewattribute. - Client apps: Bluesky, Mu, Deer… are just different interfaces on top of the same data, and each one can decide how to display it: which algorithm it uses, how it sorts the feed, what moderation it applies. If one day I don't like how Bluesky serves me the feed, I switch to another app that does it more to my liking, without losing anything.
At heart, it's the same idea as that golden age of blogs: the data is yours, and you can read it, publish it and take it wherever you want. atproto-comments is just one more small piece of that puzzle. Give it a try and, if you use it on your website, let me know by replying to this article's post: your comment will show up right down here.