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

@ln80/product-console-sdk

v0.6.1

Published

Headless React SDK for embedding product-console features (support, waitlist, contact, abuse reports) into apps and websites.

Readme

@ln80/product-console-sdk

Headless React SDK for embedding product-console features — support ticketing, waitlist, contact/inquiry, and abuse reports — into your SaaS app or marketing site.

The SDK is headless: it owns state machines, data fetching, proof-of-work, attachment uploads, and typed error handling, and exposes everything as hooks and render-prop controllers. You bring the UI, styling, and theming.

Install

npm i @ln80/product-console-sdk @tanstack/react-query react react-dom

react, react-dom, and @tanstack/react-query are peer dependencies.

Entry points

Each feature is a separate subpath export so you only load what you use:

| Import | What it provides | |---|---| | @ln80/product-console-sdk | Types only (no runtime) | | @ln80/product-console-sdk/provider | ProductConsoleProvider, useProductConsole, useSdkClient | | @ln80/product-console-sdk/support | Embedded ticketing: provider, hooks, controllers | | @ln80/product-console-sdk/waitlist | useJoinWaitlist, JoinWaitlist, useHoneypot | | @ln80/product-console-sdk/contact | useSubmitInquiry, ContactForm, INQUIRY_CATEGORIES, useHoneypot | | @ln80/product-console-sdk/trust | useSubmitAbuseReport, AbuseReportForm, ABUSE_CATEGORIES, useHoneypot |

Guides: Support integration · Public forms (waitlist / contact / abuse report) — agent-friendly, shipped with the package.

Setup

Wrap your app once with the provider, pointing it at your product-console API (including the /_pc/api prefix):

import { ProductConsoleProvider } from "@ln80/product-console-sdk/provider";

<ProductConsoleProvider config={{ apiBaseUrl: "https://api.example.com/_pc/api" }}>
  <App />
</ProductConsoleProvider>;

The provider creates and owns a TanStack Query client unless you pass your own via the queryClient prop.

Support (embedded ticketing)

Supply the customer identity from your authenticated session, then use the hooks/controllers to build the UI.

import {
  SupportProvider,
  SupportTicketList,
  SupportTicketThread,
  CreateSupportTicket,
} from "@ln80/product-console-sdk/support";

<SupportProvider identity={{ customerId: user.id, email: user.email, name: user.name }}>
  {/* New ticket */}
  <CreateSupportTicket onSuccess={({ ticketId }) => open(ticketId)}>
    {({ state, ui, actions }) => (
      <form
        onSubmit={(e) => {
          e.preventDefault();
          actions.submit({ subject, content });
        }}
      >
        {/* ...your inputs... */}
        <button disabled={!ui.canSubmit}>Send</button>
        {state.error && <p>{state.error.message}</p>}
      </form>
    )}
  </CreateSupportTicket>

  {/* List */}
  <SupportTicketList>
    {({ state, ui, actions }) =>
      ui.isLoading ? <Spinner /> : state.tickets.map((t) => <Row key={t.id} t={t} />)
    }
  </SupportTicketList>

  {/* Thread + reply composer (with attachments) */}
  <SupportTicketThread ticketId={ticketId}>
    {({ state, composer }) => (
      <>
        {state.ticket?.messages.map((m) => <Bubble key={m.id} m={m} />)}
        <textarea
          value={composer.state.content}
          onChange={(e) => composer.actions.setContent(e.target.value)}
        />
        <input
          type="file"
          multiple
          onChange={(e) => e.target.files && composer.attachments.actions.add(e.target.files)}
        />
        <button disabled={!composer.ui.canSend} onClick={() => composer.actions.send()}>
          Reply
        </button>
      </>
    )}
  </SupportTicketThread>
</SupportProvider>;

Every hook returns { state, ui, actions }. state.step is a typed state machine; errors are surfaced on state.error (typed SdkError) and never thrown.

Integrating support? See the agent-friendly Support integration guide — full API surface, a complete golden example, and do/don't rules. It ships with the package so coding assistants can read it from node_modules.

Conventions

  • Headless — no CSS, no DOM rendered by the SDK. Controllers render only what your render-prop returns.
  • Typed errors in state — branch on state.error.code.
  • Proof-of-work — computed automatically for endpoints that require it.

Build

yarn build      # vite (ESM, per-feature entries) + tsc (.d.ts)
yarn typecheck
yarn lint

Security note

When the optional support authorizer is configured, pass a host-minted token as SupportIdentity.identityToken (sent as Authorization: Bearer <token>). The authorizer is the security boundary; customerId is then a display/scoping hint overridden by gateway context. Without an authorizer, customerId is an opaque unsigned value and is spoofable by a malicious client (public PoW path).