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

@se-studio/wordpress-rest-api

v1.0.11

Published

Type-safe WordPress REST API client for Next.js headless sites with ACF field support

Readme

@se-studio/wordpress-rest-api

Type-safe client for the WordPress REST API (/wp-json/wp/v2) for Next.js headless sites. Maps WordPress pages, posts, categories, tags, and users into @se-studio/core-data-types models used by @se-studio/core-ui.

Environment variables

| Variable | Required | Description | |----------|----------|-------------| | WORDPRESS_URL | Yes | Origin of the WordPress site (no trailing slash), e.g. https://cms.example.com | | WORDPRESS_USERNAME | For preview | WP user for Application Password auth | | WORDPRESS_APPLICATION_PASSWORD | For preview | Application password (WP Admin → Users → Application Passwords) |

Preview mode adds status[]=draft|pending|publish and uses HTTP Basic auth.

Caching and revalidation

  • All fetch helpers accept the same CMS fetch shape as Contentful (preview, cache, next.revalidate, next.tags) via mapCmsFetchOptionsToWordPress() (see fetchOptions.ts).
  • Cache tag strings are centralized in cacheTags.ts and must match /api/revalidate webhook handling (revalidation/handler.ts).
  • Webhook payloads should include post_type (post, page, category, post_tag, tag, user, author, banner) and slug where applicable.

ACF (Advanced Custom Fields)

The reference Docker setup (infra/wordpress) registers a sections repeater on pages and posts. Optional SEO fields on the same field group:

  • seo_indexed (boolean, default true) — maps to link indexed / sitemap inclusion.
  • seo_hidden (boolean) — maps to hidden; production renders treat hidden as notFound when used with app-level hideIfHidden (see example-wordpress).

Optional WordPress features

| Feature | REST / setup | |---------|----------------| | Site banners | Custom post type banner with ACF fields (see api/banners.ts). If the CPT is missing, banner fetch returns []. | | 404 / CMS templates | A page with slug 404 (or template-{label} for other labels) loaded via wordpressTemplateRest. | | Custom type index | Implemented as a normal page per slug via wordpressCustomTypeRest. |

Limitations vs Contentful

  • No typed reference graph or deep include resolution; use _embed or extra requests.
  • Rich text is HTML from WordPress, not Contentful Rich Text AST.
  • Live preview overlays in Contentful (data-contentful-*) have no native WordPress equivalent; apps can leave preview helpers as no-ops.

App helper parity with Contentful

Contentful apps use createAppHelpers from @se-studio/core-ui. The WordPress reference app implements the same behaviors ( buildFetchOptions, production hideIfHidden, allowUnindexed on link lists, related articles/people, breadcrumbs, banners, templates, custom types) in apps/example-wordpress/src/lib/cms-server.ts. A future refactor may extract a createWordPressAppHelpers factory into core-ui once more than one WordPress app needs it.

Related packages

  • @se-studio/markdown-rendererWordPressMarkdownExporter for markdown export and search indexing.
  • @se-studio/searchrebuildSearchIndexWordPress() for Upstash indexing.