1: posts
Reading ModeRO
$ cat 20260508_blue-comet.md

#Building blue-comet, a Bluesky comment section for React blogs

Date:2026-05-08 (Fri)
>How I added comments to my MDX blog with public Bluesky threads, a small React component, and a CLI that links each article to its post.

##Table of Contents

##Why I wanted Bluesky comments

This Next.js and MDX blog went a long time without comments. I considered Disqus, but the ads, separate accounts, and dependence on a hosted service put me off. On Bluesky a reply is itself a post, and anyone can retrieve a public thread. If I published one Bluesky post per article, its replies could serve as comments. Readers could reply using the client they already use.

czue/bluesky-comments already explores this idea. What I wanted for my own blog was a way to automate the work of linking posts and to match the site's terminal theme. I published blue-comet on npm for that purpose.

GitHub
Updated: 2026-11-01
Avatar of liebe-magi
liebe-magi/blue-comet

Read-only Bluesky comments for blogs, with a CLI that links articles to Bluesky posts.

TypeScript 0 0 2 0

##Embedding a thread

TSX
import { BlueCometComments } from 'blue-comet';

import 'blue-comet/styles.css';

<BlueCometComments postUri="at://did:plc:.../app.bsky.feed.post/3kxyz..." />;

The component displays replies as a nested thread. “Reply on Bluesky” opens the conversation on Bluesky, and replies readers leave there appear in the comment section. You can see it running at the end of this article.

##Keeping the browser bundle small

The React entry uses fetch() to call app.bsky.feed.getPostThread on the public AppView at https://public.api.bsky.app. Normalizing just the fields needed for display keeps that entry to 4.4 KB gzipped. The CLI uses @atproto/api, which is about 700 KB minified, but it has a separate Node entry so the browser never downloads it.

##Linking articles from the command line

Bash
# Save credentials once
bluecomet login

# Create a Bluesky post for each article and write back its URI
bluecomet link posts/*.mdx

The CLI reads MDX frontmatter, fills a template with the title, description, and URL, publishes the post, then writes the returned URI back into the file:

yaml
bluesky: 'at://did:plc:.../app.bsky.feed.post/3xyz...'

I no longer have to copy a URI between Bluesky and my editor each time I publish. To make the post look like one composed in the official client, the CLI runs RichText.detectFacets() on links, mentions, and hashtags. It asks cardyb for the first URL's Open Graph metadata, uploads the preview image as a blob, and attaches an app.bsky.embed.external card.

##Matching the blog's theme

The default stylesheet is optional. The component also has 17 class-name slots, so a blog can style individual elements with Tailwind, CSS Modules, or its own design system. These are a few of the slots I use:

TSX
<BlueCometComments
  postUri={post.bluesky}
  classNames={{
    root: 'flex flex-col gap-4',
    item: 'rounded border border-white/5 bg-black/20 p-3',
    displayName: 'text-hack-primary font-bold',
    handle: 'text-hack-text/60',
    replies: 'mt-3 border-l-2 border-hack-secondary/30 pl-4',
    replyButton: 'rounded-full border border-hack-secondary/40 px-3 py-1',
  }}
/>

##Integrating it here

I added an optional bluesky?: string field to the blog's PostMetadata type. The article page renders <BlueCometComments postUri={post.bluesky} /> when the URI is present and a “Reply on Bluesky” link otherwise. Running the CLI and deploying the updated frontmatter enables the thread. You can link the whole archive in one pass or start with recent articles, as I did.

##Two design decisions

Why read-only? Posting directly inside the blog with @atproto/oauth-client-browser would require hosting OAuth client metadata, signing DPoP tokens, and persisting sessions in IndexedDB. Sending readers to their own clients keeps authentication out of the component and simplifies its implementation.

Why store a URI? I considered looking up posts by article title with searchPosts. Indexing delays and problems with cursor pagination made that unreliable. An explicit URI survives a title edit, and having the CLI write it means one less manual step.

##What's next

I released version 1.0.0-alpha.0 and plan to use it on the blog before promoting it to a stable 1.0. The default UI is in English; slots such as emptyContent already allow individual translations, and a future messages prop could group them together. The package also exports fetchThread, so there is room for a README recipe on fetching threads in an RSC or during static generation. In-blog OAuth posting is intentionally outside the scope of this library.

If you have a Bluesky account and want comments on your blog, give it a try. Feedback and bug reports are welcome here or in GitHub Issues.

GitHub
Updated: 2026-11-01
Avatar of liebe-magi
liebe-magi/blue-comet

Read-only Bluesky comments for blogs, with a CLI that links articles to Bluesky posts.

TypeScript 0 0 2 0

## Comments

"20260508_blue-comet.md" [readonly]7L, 4652B
utf-8100%