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

discourse-comments

v20260113.0.3

Published

WASM-based embedded comment system for Discourse forums

Readme

Discourse Comments

WASM-powered embedded comment system for Discourse forums.

Features

  • Framework-agnostic web component
  • WASM-based Discourse API client
  • OAuth authentication via Discourse User API Keys
  • Shadow DOM isolation
  • TypeScript support

Getting Started

1. Build the component

git clone https://github.com/ducks/discourse-comments.git
cd discourse-comments
npm install
npm run build

2. Configure your Discourse instance

In your Discourse admin panel (/admin/site_settings), configure these settings:

  • cors_origins: Add the domain where you'll host the component (e.g., https://your-blog.com)
  • user_api_key_allowed_auth_redirects: Add the full URL pattern for OAuth redirects (e.g., https://your-blog.com/*)

3. Create a topic for comments

Create a topic in your Discourse forum that will hold the comments. Note the topic ID from the URL (e.g., /t/my-post-comments/123 has topic ID 123).

4. Add to your page

Copy the dist/ and wasm/ folders to your site, then add:

<script type="module" src="./dist/index.js"></script>

<discourse-comments
  discourse-url="https://your-forum.com"
  topic-id="123">
</discourse-comments>

Development

npm install
npm run build

Open demo.html in a browser to see the component in action.

Requirements

Discourse Version: For authenticated commenting (OAuth login), your Discourse instance must be running a version from December 11, 2025 or later. This is when RSA-OAEP padding support was added for User API Key encryption (PR #36592).

Anonymous comment reading works on any Discourse version.

CORS Configuration: Your Discourse instance needs to allow requests from wherever you host this component. Set cors_origins in site settings.

OAuth Redirect: For login to work, add your demo URL to the allowed user_api_key_allowed_auth_redirects site setting.

Architecture

  • src/discourse-comments.ts - Web component implementation
  • WASM client from discourse-api-rs