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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nextwp/core

v0.0.2

Published

<img width="1104" alt="image" src="https://github.com/CalebBarnes/nextwp/assets/24890515/cbecbc2a-e170-41a1-a0a6-2d3f3e69f1d8">

Downloads

67

Readme

@nextwp/core

npm version npm

NextWP

Welcome to the new era of Headless WordPress development.

Quickstart | Explore packages | Documentation

What is NextWP?

NextWP is a library built on the WP REST API and Next.js App Router that streamlines the process of building super fast Headless WordPress sites with Next.js. It provides a set of tools and utilities to help you build interactive, dynamic, and performant sites with WordPress and Next.js.

Why does NextWP use the WP REST API?

Features

WordPress Theme

The easiest way to get started is to install NextWP Headless Theme in your WordPress site. This will install the required plugins and offer optional recommended plugins to improve the headless WP experience.

Prerequisites

Ensure you have the following WordPress plugins installed:

  • Advanced Custom Fields: Enables custom fields in WordPress.
  • Yoast SEO: Provides SEO features for WordPress sites.
  • NextWP - Headless Toolkit: Essential for CMS previews in NextJS.

Quick Start

One click deploy a new project to Vercel:

Deploy with Vercel

Or, you can get up and running by using the cli tool create-nextwp-app:

npx create-nextwp-app

If you want to add to an existing project, you can install the @nextwp/core package:

Install @nextwp/core in your Next.js project:

npm install @nextwp/core

Here is a basic example of how to use @nextwp/core in your existing Next.js project:

// src/app/[[...paths]]/page.tsx
import { WordpressTemplate } from "@nextwp/core";
import templates from "@/templates";

export default function PageTemplate(props) {
  return (
    <WordpressTemplate
      params={props.params}
      searchParams={props.searchParams}
      templates={templates}
    />
  );
}

export { generateMetadata, generateStaticParams } from "@nextwp/core";

Read the NextWP docs for more information on how to use @nextwp/core.

Configuration

Environment Variables

The following environment variables are required for configuring @nextwp/core:

  • NEXT_PUBLIC_WP_URL: The URL of your WordPress site.
  • NEXT_SITE_URL: The URL of your Next.js site.
  • REVALIDATE_SECRET_KEY: A secret key used for revalidation.
  • WP_APPLICATION_PASSWORD: The application password for authenticating with WordPress.
  • NEXT_PREVIEW_SECRET: The secret key for preview mode.

Make sure to set these environment variables in your project's configuration.

Read more about environment variables.