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

@primocaredentgroup/page-feedback

v1.3.2

Published

A page feedback component for Convex.

Readme

Convex Page Feedback

Release 1.3.2 restores application source from 01e1157e before the October 28 bounded-read changes. The additional projection/preparation tables from that change are absent. This source rollback also restores the previous read behavior; it does not claim to resolve the remaining broad reads. The existing Core dependency remains unchanged.

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

For guided testing and training, the component can also model role-based test paths:

  • admins define roles such as AM
  • admins attach ordered tests to each role, with optional videoUrl
  • users can have multiple roles assigned at the same time
  • users complete each test by submitting required feedback

It also includes a singleton settings record for optional bug-report and improvement-request URLs controlled by the consumer app. settings also stores adminUserIds, a simple built-in allowlist for role/test administration.

Found a bug? Feature request? File it here.

Installation

npm install @primocaredentgroup/page-feedback

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 '@primocaredentgroup/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 '@primocaredentgroup/page-feedback'

export const {
  getMyFeedback,
  upsertFeedback,
  setFeedbackSolved,
  listFeedbackVersions,
  listLatestFeedbackForUrl,
  listObjectivesForUrl,
  upsertObjective,
  listIndicatorsForObjective,
  upsertIndicator,
  listComments,
  listObjectiveComments,
  addComment,
  addObjectiveComment,
  editComment,
  deleteComment,
  getCommentReactions,
  toggleReaction,
  getSettings,
  setSettings,
  listRoles,
  upsertRole,
  archiveRole,
  listRoleTestsForRole,
  upsertRoleTest,
  archiveRoleTest,
  assignRoleToUser,
  removeRoleFromUser,
  listRoleAssignments,
  listMyAssignedRoleTests,
  getRoleTestDetail,
  completeRoleTestWithFeedback,
} = 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')
    }
  },
})

If you omit adminAuth, exposeApi uses settings.adminUserIds as the admin check. When the list is empty, the first authenticated caller can bootstrap the settings:

await setSettings({ adminUserIds: ['user_123'] })

See more example usage in example.ts.

Data model

The component stores data in twelve 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
  • roles: admin-defined user roles, for example AM
  • roleTests: ordered tests attached to a role, including target URL and optional videoUrl
  • userRoleAssignments: many-to-many assignments so one user can have multiple roles
  • roleTestProgress: per-user test completion declarations linked to feedback threads
  • settings: singleton configuration document keyed internally as global

URL identity

The default urlMode: 'page' preserves the previous behavior exactly: trim the URL and take everything before ?. A fragment without a preceding query is retained for compatibility.

Opt in to full URL identity in your server integration:

const feedback = exposeApi(components.pageFeedback, {
  urlMode: 'full',
  auth: async (ctx) => { /* return the authenticated user ID */ },
})
registerRoutes(http, components.pageFeedback, { urlMode: 'full' })

Use the same mode for exposeApi and registerRoutes. Full mode trims only outer whitespace and preserves the origin, path, query, parameter order, encoding and fragment exactly. Different query values, parameter orders or fragments identify different threads and objectives. Pass the complete URL from your frontend (for example window.location.href); the server cannot recover omitted parameters. The authorization callback receives the same canonical URL used for storage. Direct component calls accept an optional urlMode argument on URL-based operations and upsertRoleTest; omission keeps page mode.

New or edited role tests store their target using the selected mode. Completion always uses that stored target exactly, even if the host configuration changes.

Existing threads, versions, objectives and role tests are never rewritten. Queries discarded by earlier releases cannot be recovered. After enabling full mode, an URL with parameters starts a separate thread; old threads remain visible in the registry/history and can be opened using their saved normalizedUrl. Existing role tests retain their saved targets and completion records.

Migrating from the old npm scope

Install @primocaredentgroup/[email protected] and replace imports from @okrlinkhub/page-feedback, including /convex.config.js and /react. Keep the Convex component mount name pageFeedback to preserve its existing data. Run Convex codegen and your application checks before deploying. Package migration alone retains page mode; enabling full mode is an explicit server configuration. Historical versions of the old package remain installable. See Publishing for the ordered release and deprecation procedure.

roleTestProgress.isCompleted is the only field used for role-test completion percentages. It is a user declaration saved by completeRoleTestWithFeedback. feedbackThreads.isSolved is only a feedback discussion state and never affects test completion.

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?, adminUserIds? })
  • lib.listRoles({ limit? })
  • lib.upsertRole({ roleId?, name, description?, status, order })
  • lib.archiveRole({ roleId })
  • lib.listRoleTestsForRole({ roleId, limit? })
  • lib.upsertRoleTest({ roleTestId?, roleId, title, description, targetUrl, videoUrl?, status, order })
  • lib.archiveRoleTest({ roleTestId })
  • lib.assignRoleToUser({ userId, roleId })
  • lib.removeRoleFromUser({ userId, roleId })
  • lib.listRoleAssignments({ userId?, roleId?, limit? })
  • lib.listMyAssignedRoleTests({ userId })
  • lib.getRoleTestDetail({ userId, roleTestId })
  • lib.completeRoleTestWithFeedback({ userId, roleTestId, rating, note })

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.

completeRoleTestWithFeedback requires a non-empty note, reuses the existing versioned feedback system for the test target URL, then writes roleTestProgress.isCompleted = true in the same mutation. For example, if role AM has four active tests, the returned role progress moves through 0, 25, 50, 75, and 100 percent as the user completes them.

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 '@primocaredentgroup/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