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

@scribe-atp/next

v1.2.0

Published

Next.js App Router adapter for reading Scribe CMS content from the AT Protocol.

Downloads

1,446

Readme

@scribe-atp/next

npm license

Next.js App Router adapter for reading Scribe CMS content from the AT Protocol. Requires Next.js 13 or later.

Wraps @scribe-atp/core with Next.js-idiomatic factories for generateStaticParams and generateMetadata.

App Router only. For Pages Router support, use @scribe-atp/core directly — see Pages Router below.

Installation

npm install @scribe-atp/next

Usage

Create a factory once and export its functions from your route files:

// lib/scribe.ts
import { createScribeSite } from "@scribe-atp/next";

export const scribe = createScribeSite("alice.bsky.social", "https://alice.bsky.social");

Group index route — /blog/[groupSlug]

// app/blog/[groupSlug]/page.tsx
import { scribe } from "@/lib/scribe";

export const generateStaticParams = scribe.generateGroupParams;
// → [{ groupSlug: "tech" }, { groupSlug: "life" }]

export const generateMetadata = ({ params }: { params: { groupSlug: string } }) =>
  scribe.generateGroupMetadata(params.groupSlug);

export default function GroupPage({ params }: { params: { groupSlug: string } }) {
  // ...
}

Article route — /blog/[groupSlug]/[articleSlug]

// app/blog/[groupSlug]/[articleSlug]/page.tsx
import { scribe } from "@/lib/scribe";

export const generateStaticParams = scribe.generateGroupArticleParams;
// → [{ groupSlug: "tech", articleSlug: "hello" }, ...]

export const generateMetadata = ({ params }: { params: { articleSlug: string } }) =>
  scribe.generateArticleMetadata(params.articleSlug);

export default function ArticlePage({ params }: { params: { groupSlug: string; articleSlug: string } }) {
  // ...
}

Flat article route — /blog/[articleSlug]

// app/blog/[articleSlug]/page.tsx
import { scribe } from "@/lib/scribe";

export const generateStaticParams = scribe.generateArticleParams;
// → [{ articleSlug: "hello" }, { articleSlug: "second" }, ...]

Site index metadata

// app/blog/page.tsx
import { scribe } from "@/lib/scribe";

export const generateMetadata = scribe.generateSiteMetadata;

Metadata

The metadata generators are opinionated by design. They produce complete, ready-to-use Metadata objects including OpenGraph tags — you don't need to wire these up manually.

| Generator | title | description | OpenGraph | | --------- | ------- | ------------- | --------- | | generateSiteMetadata | site.title | site.description | title, description, splash image | | generateGroupMetadata | "Group — Site" | — | title | | generateArticleMetadata | "Article — Site" | article.synopsis | title, description, splash image |

Article metadata uses the cached ArticleRef snapshot already present in the site record — no extra network request per article at build time.

Standalone metadata helpers

Outside the factory pattern, articleMetadata and siteMetadata are exported as standalone functions that accept an Article/Site object directly. These are useful when you're already fetching content yourself and just need the Metadata object:

import { articleMetadata, siteMetadata } from "@scribe-atp/next";
import { fetchArticleBySlug, fetchSite } from "@scribe-atp/core";

export async function generateMetadata({ params }: { params: { slug: string } }) {
  const [{ article }, site] = await Promise.all([
    fetchArticleBySlug("alice.bsky.social", "https://alice.bsky.social", params.slug),
    fetchSite("alice.bsky.social", "https://alice.bsky.social"),
  ]);
  return articleMetadata(article, site);
}

Need custom metadata? Call fetchSite or fetchArticle from @scribe-atp/core directly and compose your own Metadata object:

import { fetchSite } from "@scribe-atp/core";
import type { Metadata } from "next";

export async function generateMetadata(): Promise<Metadata> {
  const site = await fetchSite("alice.bsky.social", "https://alice.bsky.social");
  return {
    title: `${site.title} | My Platform`,
    // custom fields...
  };
}

ISR (Incremental Static Regeneration)

The SDK does not configure Next.js fetch caching. Use Next.js route segment config to control revalidation:

// app/blog/[groupSlug]/[articleSlug]/page.tsx
export const revalidate = 3600; // revalidate every hour

Pages Router

@scribe-atp/next targets the App Router only. For Pages Router, use @scribe-atp/core directly:

// pages/blog/[slug].tsx
import type { GetStaticPaths, GetStaticProps } from "next";
import { fetchSite, fetchArticle } from "@scribe-atp/core";

export const getStaticPaths: GetStaticPaths = async () => {
  const site = await fetchSite("alice.bsky.social", "https://alice.bsky.social");
  const paths = site.groups.flatMap((group) =>
    group.articles.map((article) => ({ params: { slug: article.url ?? "" } }))
  );
  return { paths, fallback: false };
};

export const getStaticProps: GetStaticProps = async ({ params }) => {
  const article = await fetchArticle("alice.bsky.social", params!.slug as string);
  return { props: { article } };
};

TypeScript types

All types from @scribe-atp/core are re-exported:

import type { Site, Article, ArticleRef, SiteGroup } from "@scribe-atp/next";

License

MIT