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

visual-comments

v0.2.0

Published

Comments pinned to the elements of any web page or app, with one comment server for every site.

Readme

visual-comments

Comments pinned to the elements of any web page or app, like a design tool's comments or Vercel's preview comments. People press C, click the element they mean, and start a thread pinned to it. One self-hosted comment server holds the threads of many sites; each site signs its own people in and passes their comment requests on through its own server.

This package is the browser library (Svelte 5), the server-side proxy, the SvelteKit adapter, the command for coding agents, and the script-tag build. The comment server and full documentation live in the repository.

npm install visual-comments

Proxy the comment requests

The site's server passes /_comments/* on to the comment server with the space's secret and the signed-in person:

// src/hooks.server.ts
import { sequence } from '@sveltejs/kit/hooks';
import { commentsProxy } from 'visual-comments/server';

const comments = commentsProxy({
	server: 'https://comments.example.com',
	space: 'my-team',
	secret: env.COMMENTS_SECRET // the space's secret; never sent to browsers
});

// After the site's sign-in hook, which sets `event.locals.user`.
export const handle = sequence(signIn, comments.sveltekit());

Other servers call comments.handle(request, user). See the proxy protocol.

Add comments to the page

import { createVisualComments } from 'visual-comments';

const comments = createVisualComments({
	endpoint: '/_comments', // the default
	auth: '/auth',
	show: (thread) => canvas.zoomTo(thread.surface) // return true when handled
});

The library compiles with the host's Svelte (a peer dependency). Its options are in the library reference. Pages without a bundler can use the script build instead, served by the comment server at /v1/visual-comments.js and also shipped here as visual-comments/widget.js; see the markup reference.

SvelteKit

visual-comments/sveltekit sets the comments up from environment variables (VISUAL_COMMENTS_ENABLED, _SERVER, _SPACE, _SECRET): a hook, a layout load, and <Comments> with a <Toolbar> at the bottom of the window. They can sign people in on their own, apart from the app's accounts, and the visualComments() Vite plugin from visual-comments/vite leaves them out of production builds. See the SvelteKit guide.

Coding agents

The package's visual-comments command lets a coding agent join a space: npx visual-comments connect <site>, then next to wait for new comments, reply and presence. See coding agents.

License

MIT