Publish to a Next.js Blog
The Next.js Blog integration is an npm package. Install @narraseo/next-blog, scaffold a blog route, add your project API credentials, and optionally add webhook revalidation. Requires Creator or above.
Last updated 1 day ago
This is a developer integration, not a CMS connection. Instead of pushing posts into a CMS, your Next.js site pulls articles from NarraSEO through a package.
Listed as Next.js Blog under Developer.
Plan Requirement
Creator or above, because it needs a project API key.
If you are on a lower plan you see "The Next.js Blog package needs a project API key, which requires Creator or above". The setup guide stays readable, so you can see what is involved before deciding to upgrade.
Requirements
Node.js 18 or later, and a Next.js project using the App Router.
Setup
There are four steps, with the last one optional.
1. Install the Package
Install the public @narraseo/next-blog package in your Next.js project.
2. Scaffold the Blog
``bash npx @narraseo/next-blog init ``
This scaffolds a /blog route.
3. Add your API Credentials
Generate a key and add the environment variables the guide shows.
You can create the key from this integration with Create API key, or from the API integration directly. Copy it when it is shown, since the full value is not displayed again.
4. Optional: Webhook Revalidation
Use Set up webhooks to have NarraSEO notify your site when an article is published, so your pages revalidate without waiting for a rebuild.
Worth doing if you use static generation. Without it, a newly published article appears when your site next rebuilds.
Buttons on This Integration
There is no credential form. Two buttons:
- Create API key
- Set up webhooks
Both take you to the relevant developer integration.
Publishing to It
Publish as you would to any destination, choosing the Next.js target in the Publish panel.
When This is the Right Choice
Your site is already Next.js. If you have a custom Next.js site with no CMS, this gives you a blog without adding one.
You want the content in your own front end. You control the rendering completely, which no CMS integration gives you.
You are comfortable with a code deployment. This is a developer setup. There is a command to run, environment variables to set, and a deploy to do.
If none of that describes you, one of the CMS integrations or a Markdown download will be less work.
Notes
Creator includes 25,000 API requests and 5,000 webhook deliveries a month.
The package is public, so you can inspect it before installing.
Keep the API key in environment variables and out of your repository. It grants access to your project's content.
If you use webhook revalidation, your endpoint must be reachable over HTTPS and should return a 2xx response quickly.
Related
Using the NarraSEO API covers the API key and endpoints directly. Sending content with webhooks covers the webhook side.