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

@okrlinkhub/page-feedback

v1.1.0

Published

A page feedback component for Convex.

Readme

Convex Page Feedback

npm version

Collect versioned page feedback per user and URL inside an isolated Convex component.

The component keeps exactly one active feedback thread per userId + normalizedUrl, stores every update as a new version, and lets each feedback thread host:

  • linear discussion comments
  • emoji reactions on comments

It also supports a shared page-purpose layer per normalizedUrl with:

  • ordered objectives describing what the page should achieve
  • lightweight indicators attached to each objective
  • discussion threads attached to each objective

It also includes a singleton settings record for optional bug-report and improvement-request URLs controlled by the consumer app.

Found a bug? Feature request? File it here.

Installation

Create a convex.config.ts file in your app's convex/ folder and install the component by calling use:

// convex/convex.config.ts
import { defineApp } from 'convex/server'
import pageFeedback from '@okrlinkhub/page-feedback/convex.config.js'

const app = defineApp()
app.use(pageFeedback)

export default app

Then run component codegen in your project:

npx convex dev --typecheck-components

Usage

import { components } from './_generated/api'
import { exposeApi } from '@okrlinkhub/page-feedback'

export const {
  getMyFeedback,
  upsertFeedback,
  setFeedbackSolved,
  listFeedbackVersions,
  listLatestFeedbackForUrl,
  listObjectivesForUrl,
  upsertObjective,
  listIndicatorsForObjective,
  upsertIndicator,
  listComments,
  listObjectiveComments,
  addComment,
  addObjectiveComment,
  editComment,
  deleteComment,
  getCommentReactions,
  toggleReaction,
  getSettings,
  setSettings,
} = exposeApi(components.pageFeedback, {
  auth: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity()

    if (!identity) {
      throw new Error('Unauthorized')
    }

    return identity.tokenIdentifier
  },
  adminAuth: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity()

    if (!identity) {
      throw new Error('Admin access required')
    }
  },
})

See more example usage in example.ts.

Data model

The component stores data in eight tables:

  • feedbackThreads: latest feedback snapshot for each userId + normalizedUrl, including isSolved
  • feedbackVersions: append-only history for each feedback thread
  • feedbackComments: linear discussion messages attached to a feedback thread
  • feedbackReactions: emoji reactions attached to a feedback comment
  • pageObjectives: shared objectives for a normalized page URL
  • objectiveIndicators: ordered indicators for a single objective
  • objectiveComments: discussion messages attached to a page objective
  • settings: singleton configuration document keyed internally as global

The URL is normalized inside both the component and the client wrapper by taking everything before ?.

Public component API

The installed component exposes these public functions:

  • lib.upsertFeedback({ userId, url, rating, note })
  • lib.setFeedbackSolved({ userId, threadId, isSolved })
  • lib.getMyFeedback({ userId, url })
  • lib.listFeedbackVersions({ userId, url, limit? })
  • lib.listLatestFeedbackForUrl({ url, limit? })
  • lib.listObjectivesForUrl({ url })
  • lib.upsertObjective({ objectiveId?, url, description, status, order })
  • lib.listIndicatorsForObjective({ objectiveId })
  • lib.upsertIndicator({ indicatorId?, objectiveId, description, order })
  • lib.listComments({ threadId, limit?, currentUserId? })
  • lib.listObjectiveComments({ objectiveId, limit? })
  • lib.addComment({ userId, threadId, body })
  • lib.addObjectiveComment({ userId, objectiveId, body })
  • lib.editComment({ userId, commentId, body })
  • lib.deleteComment({ userId, commentId })
  • lib.getCommentReactions({ commentId, currentUserId? })
  • lib.toggleReaction({ userId, commentId, emoji })
  • lib.getSettings({})
  • lib.setSettings({ bugReportUrl?, improvementRequestUrl? })

rating is constrained to integers from 1 to 3.

isSolved is a thread-level state, not a versioned feedback field. Updating the rating or note still creates a new row in feedbackVersions, while changing isSolved only updates the latest thread snapshot. For compatibility with existing installations, older threads without isSolved are treated as unsolved until they are updated.

This release intentionally does not include mentions or realtime typing. Those can be layered in later without coupling the component to a specific user directory or notification architecture.

Best practices

This component follows the official Convex guidance for components from Authoring Components:

  • authentication remains in the consumer app, not inside the component
  • the component owns its own tables and persistence boundary
  • public functions define both argument and return validators
  • external app identifiers such as userId are passed explicitly across the component boundary

HTTP Routes

You can register a read-only HTTP endpoint for page feedback:

import { httpRouter } from 'convex/server'
import { registerRoutes } from '@okrlinkhub/page-feedback'
import { components } from './_generated/api'

const http = httpRouter()

registerRoutes(http, components.pageFeedback, {
  pathPrefix: '/feedback',
})

export default http

This exposes GET /feedback/latest?url=... and returns the latest feedback entries for the requested normalized URL. See http.ts for a complete example.

Run the example:

npm i
npm run dev