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 server or database.
- 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 (how to get it):
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/atproto-comments@1/dist/atproto-comments.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/atproto-comments@1/dist/index.js"></script>
<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 AT Protocol account 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, where 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, tested it and the same thing happened.
To understand my surprise, here's the same Eurosky post seen through three apps:
Wait, this reminded me of something I'd already lived through. Of course — I miss it! Blogs, RSS, Google Reader and Feedly. When the internet was decentralized, what we published was ours and what we read 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, every account has a permanent identifier (DID) and its data lives on a personal data server (PDS), 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. We can consume our data, and that of the people we follow, from different apps. And we can build tools like atproto-comments 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 (@xulioze.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: because the data is spread across many PDSes, the Relay gathers it and rebroadcasts its changes in a single real-time 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. Keep in mind that this request comes from each visitor's browser and that, since the comments load with JavaScript, search engines don't usually index them. - 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, the idea is very similar to RSS and blogs: the data belongs to whoever publishes it and they can take it wherever they want. Each person decides how and where to consume it. And anyone can build tools for the ecosystem without asking permission, like atproto-comments, which we're launching here today.
If you already have an AT Protocol account, leave a comment down here from your favorite app (Bluesky, Mu, Deer…) and you'll see it show up. If you don't, create an account on Eurosky and use it in whichever app you like. Welcome to open social networks!