npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bsky-comments-client

v0.1.0

Published

Privacy-respecting Bluesky comments as a zero-dependency web component, with an optional proxy mode that keeps reader IPs off Bluesky.

Readme

bsky-comments-client

A zero-dependency web component that renders a Bluesky post's replies as a comment thread on any website. It works on its own against Bluesky's public API, and it can point at a self-hosted proxy so that a reader's IP address never reaches Bluesky.

Why

Most "Bluesky comments" widgets fetch the thread straight from the reader's browser, which discloses every reader's IP to Bluesky. This component supports that direct mode, but it also speaks to an optional proxy that mirrors the same read endpoints. Point the component at your proxy and the browser only ever talks to your origin. Same markup, one extra attribute.

The component ships no runtime dependencies, injects no inline styles, and builds its DOM from text nodes, so it slots into a strict Content Security Policy.

Install

From a CDN, pinned to a version and with Subresource Integrity:

<link rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/dist/bsky-comments.css"
  integrity="sha384-…" crossorigin="anonymous">
<script type="module"
  src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bsky-comments.min.js"
  integrity="sha384-…" crossorigin="anonymous"></script>

[!NOTE] Replace each integrity hash with the one published for the version you pin. Loading versionless or hash-less CDN URLs trusts the CDN not to alter the file. Under a strict CSP, self-hosting (below) avoids the third-party origin entirely and is the recommended path.

Or from npm, to self-host or bundle:

npm install bsky-comments-client
import "bsky-comments-client";

The package also ships a minified IIFE build (dist/bsky-comments.min.js) for a plain <script> tag, and the stylesheet at bsky-comments-client/style.css.

Usage

Make a Bluesky post that links to your page, then drop its URL into the component:

<bsky-comments post="https://bsky.app/profile/you.bsky.social/post/3abc..."></bsky-comments>

The post's replies become the comment thread. To comment, a reader replies to your post on Bluesky.

Direct vs proxy mode

Without an endpoint, the component fetches from public.api.bsky.app directly. This needs no infrastructure, but each reader's browser contacts Bluesky.

<!-- Direct: real-time, reveals the reader's IP to Bluesky -->
<bsky-comments post="..."></bsky-comments>

<!-- Proxy: real-time, reader's IP only reaches your origin -->
<bsky-comments post="..." endpoint="https://comments.example.com"></bsky-comments>

In proxy mode the component sends the same requests to endpoint instead. The proxy is expected to mirror com.atproto.identity.resolveHandle and app.bsky.feed.getPostThread under an /xrpc/ path, cache the responses, and rewrite avatar URLs to itself if you want avatars private too.

Attributes

| Attribute | Values | Default | Description | |------------|---------------------------------|------------|-------------| | post | Bluesky post URL or at:// URI | (required) | The post whose replies are shown | | endpoint | proxy base URL | (none) | When set, requests go here instead of Bluesky | | trigger | button, auto, visible | button | When to fetch: on click, on load, or when scrolled into view | | sort | likes, newest, oldest | likes | Order of replies | | depth | integer | 6 | How deep to fetch nested replies |

button is the default so that, in direct mode, a reader only contacts Bluesky if they choose to load comments.

Theming

The component renders into the light DOM with bsky-comments__* classes and reads its colors from custom properties, so host CSS applies directly. Override any of:

.bsky-comments__root {
  --bskyc-fg: #111;
  --bskyc-muted: #667;
  --bskyc-link: #0645ad;
  --bskyc-border: #e3e3e3;
  --bskyc-avatar-bg: #d9d9d9;
}

A prefers-color-scheme: dark block ships defaults for dark mode.

Content Security Policy

The component needs no script or style relaxation (script-src 'self', style-src 'self'). It only adds a fetch origin and an image origin, which differ by mode:

# Direct mode
connect-src https://public.api.bsky.app;
img-src https://cdn.bsky.app;

# Proxy mode (avatars mirrored by the proxy)
connect-src https://comments.example.com;
img-src 'self' https://comments.example.com;

Privacy

  • Requests are sent with credentials: omit and referrerPolicy: no-referrer.
  • No cookies are set or read.
  • Reply text is inserted as text nodes; rich-text links are resolved to <a> elements restricted to http(s) and marked rel="nofollow ugc".
  • In direct mode, avatars and the thread fetch contact Bluesky. In proxy mode, with a proxy that mirrors avatars, the browser contacts only your origin.

Browser support

Any browser with custom elements, fetch, and IntersectionObserver (all evergreen browsers). No polyfills are bundled.

Building from source

npm install
npm run build      # esbuild bundles to dist/, tsc emits type declarations
npm run typecheck

Open examples/index.html through a local static server to try it against a live post.

License

MIT, © 2026 Francisco Laplace. See LICENSE.