Getting Started

Create and publish SEO optimized articles within minutes 🚀

Installation

Install our package into your existing project using your package manager of choice.

1npm install nxtblog-ai --save

Setup

Step 1: Initialize nxtblog.ai in Your Next.js Project

and copy your project key in the project dashboard. Use the project key to initialize nxtblog.ai in your Next.js project. The following command will create a new dynamic route in your Next.js app where your blog posts will be published with our prebuilt components. It will use the route you specified when creating your project. If you chose /blog, it will create a new route /blog/[articlePath] where your blog posts will be published.
1npx nxtblog-ai init --project-key <your-project-key>

Step 2: Add environment variables (Optional)

Optional: The following environment variables will be automatically added to your .env file. Make sure they are also present in your production environment.
1# .env
2# ... your other env variables ...
3NEXT_ARTICLE_CDN_URL="https://nxtblog.ai/api/cdn/v1"
4NEXT_ARTICLE_PROJECT_KEY=<your_project_key-here>

Step 3: Enable Image Support (Optional)

Optional: To enable images in your blog posts, add the following to your next.config.js file to allow our CDN to serve the images to your server.
1// next.config.js
2const config = {
3  // ... your other next options ...
4  images: {
5      remotePatterns: [
6          {
7              protocol: "https",
8              hostname: "nxtblog.ai",
9              pathname: "/api/cdn/**"
10          }
11      ]
12  }
13};
14export default config;
That's it! You are now ready to start generating SEO optimized articles for your blog.