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

@faqapp/nextjs

v0.1.1

Published

Next.js SDK for TheFAQApp — React hooks, components, SSR/SSG helpers, and SEO utilities

Readme

@faqapp/nextjs

Next.js components, hooks, and SEO utilities for TheFAQApp.

Install

npm install @faqapp/core @faqapp/nextjs
# or
pnpm add @faqapp/core @faqapp/nextjs

Components

FaqList

Renders a searchable, filterable FAQ list with category grouping:

import { FAQClient } from "@faqapp/core";
import { FaqList } from "@faqapp/nextjs/components";

export default async function FAQPage() {
  const faq = new FAQClient({ apiKey: "...", organizationSlug: "..." });
  const questionsPage = await faq.questions.list({ limit: 100 });
  const categoriesPage = await faq.categories.list();

  return (
    <FaqList
      questions={questionsPage.data}
      categories={categoriesPage.data}
      searchable
      showCategories
      onQuestionClick={(q) => console.log(q.slug)}
    />
  );
}

QuestionDetail

Renders a single question with answer, feedback buttons, and related questions:

import { QuestionDetailComponent } from "@faqapp/nextjs/components";

<QuestionDetailComponent
  question={questionDetail}
  showFeedback
  onFeedbackSubmit={async (feedback) => {
    await faq.feedback.submit(slug, feedback);
  }}
/>

Hooks

useFaq

Fetches and manages a paginated list of questions:

"use client";

import { useFaq } from "@faqapp/nextjs/hooks";
import { FaqList } from "@faqapp/nextjs/components";

function FaqWidget() {
  const { data, loading, error, refetch, updateFilters } = useFaq({
    config: { apiKey: "...", organizationSlug: "..." },
    autoFetch: true,
  });

  if (loading) return <p>Loading…</p>;
  if (error) return <p>Error: {error.message}</p>;

  return (
    <div>
      <FaqList questions={data.questions} />
      <p>Page {data.pagination?.page} of {data.totalPages}</p>
      <button onClick={() => updateFilters({ page: 2 })}>Next page</button>
    </div>
  );
}

useQuestion

Fetches a single question by slug with feedback support:

"use client";

import { useQuestion } from "@faqapp/nextjs/hooks";

function QuestionPage({ slug }: { slug: string }) {
  const { data, loading, error, submitFeedback } = useQuestion({
    config: { apiKey: "...", organizationSlug: "..." },
    questionSlug: slug,
  });

  if (loading) return <p>Loading…</p>;
  if (error) return <p>Error: {error.message}</p>;

  return (
    <div>
      <h1>{data.question?.question}</h1>
      <div dangerouslySetInnerHTML={{ __html: data.question?.answer ?? "" }} />
      <button onClick={() => submitFeedback({ helpful: true })}>👍 Helpful</button>
    </div>
  );
}

useSearch

Search questions with a query string:

"use client";

import { useSearch } from "@faqapp/nextjs/hooks";

function SearchWidget() {
  const { data, loading, error, search } = useSearch({
    config: { apiKey: "...", organizationSlug: "..." },
  });

  return (
    <div>
      <input onChange={(e) => search(e.target.value)} placeholder="Search FAQs…" />
      {loading && <p>Searching…</p>}
      {data?.results.map((r) => (
        <div key={r.id}>{r.question}</div>
      ))}
    </div>
  );
}

SEO Utilities

Generate JSON-LD FAQPage schema for Google rich results:

import { generateFaqJsonLd, generateFaqSeoData, generateQuestionSeoData } from "@faqapp/nextjs";

// Simple JSON-LD from questions
const jsonLd = generateFaqJsonLd(questions);

// Full SEO data with organization context
const seoData = generateFaqSeoData({
  organization,
  questions,
  baseUrl: "https://example.com",
  currentPath: "/faq",
});

// Render in <head>
<script
  type="application/ld+json"
  dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>

SSR / SSG Helpers

import {
  getFaqStaticProps,
  getQuestionStaticProps,
  getAllQuestionSlugs,
  getAllCategorySlugs,
} from "@faqapp/nextjs";

// In getStaticProps
export async function getStaticProps() {
  return getFaqStaticProps({
    config: { apiKey: "...", organizationSlug: "..." },
    filters: { limit: 50 },
  });
}

// In getStaticPaths
export async function getStaticPaths() {
  const slugs = await getAllQuestionSlugs({
    config: { apiKey: "...", organizationSlug: "..." },
  });

  return {
    paths: slugs.map((slug) => ({ params: { slug } })),
    fallback: "blocking",
  };
}

Sitemap Generation

import { generateFaqSitemap, generateSitemapXml } from "@faqapp/nextjs";

const entries = generateFaqSitemap({
  questions,
  categories,
  baseUrl: "https://example.com",
  basePath: "/faq",
});

const xml = generateSitemapXml(entries);

License

MIT