{"_id":"@dropinblog/nextjs-rendered","_rev":"23-f4a3add406bb7eb1b3a8aef7d6a44d6e","name":"@dropinblog/nextjs-rendered","dist-tags":{"latest":"2.0.6"},"versions":{"2.0.6":{"name":"@dropinblog/nextjs-rendered","version":"2.0.6","keywords":["dropinblog","react","nextjs","component","blog"],"author":{"name":"DropInBlog"},"license":"ISC","_id":"@dropinblog/nextjs-rendered@2.0.6","maintainers":[{"name":"jason18505","email":"jason@dropinblog.com"},{"name":"schoberg","email":"jesse@dropinblog.com"},{"name":"nidal1","email":"touhami9@gmail.com"}],"homepage":"https://github.com/DropInBlog/nextjs-rendered#readme","bugs":{"url":"https://github.com/DropInBlog/nextjs-rendered/issues"},"dist":{"shasum":"3f059f674a82fcaa5f9cddb71b6ee528125a8afa","tarball":"https://registry.npmjs.org/@dropinblog/nextjs-rendered/-/nextjs-rendered-2.0.6.tgz","fileCount":11,"integrity":"sha512-TMzkcKXZoWgeK8JR7fxTL5NMNvbVkMCR5QIPqCw0VdMmoJ6c0syB7cAER5Tf+EtG7k85ssQPPqoHQBiYm7terw==","signatures":[{"sig":"MEYCIQDFDDqGErPkNt+bU1Fdul4KSdjL5MNP2GWwwahINu0ffgIhANSXzFgQ6t07u0pJ0BuN11lGxm0Vl3FOY9qA4T55rppQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19500},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.esm.js","engines":{"node":">=18"},"gitHead":"7bfd331b55b8cd414e94c9329f4a6c852cb83610","scripts":{"pub":"npm run build && npm publish --access public","pack":"rm -f dropinblog-*.tgz && npm run build && npm pack","build":"tsup","bump:major":"npm version major","bump:minor":"npm version minor","bump:patch":"npm version patch"},"_npmUser":{"name":"jason18505","email":"jason@dropinblog.com"},"repository":{"url":"git+https://github.com/DropInBlog/nextjs-rendered.git","type":"git"},"_npmVersion":"11.6.0","description":"DropInBlog rendered content for Next.js projects.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^7.2.0","typescript":"^5.8.3","@types/react":"^18.3.23 || ^19"},"peerDependencies":{"next":"^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0","react":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nextjs-rendered_2.0.6_1770668008705_0.0858162731550296","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-02-09T20:13:28.599Z","modified":"2026-07-08T15:44:02.046Z","1.0.2":"2025-08-09T18:55:36.629Z","1.0.3":"2025-08-11T17:52:14.623Z","1.0.4":"2025-08-20T15:14:17.237Z","1.0.5":"2025-08-21T15:12:56.506Z","1.0.6":"2025-08-21T15:25:32.512Z","1.0.7":"2025-09-04T16:18:15.622Z","1.0.8":"2025-09-16T12:34:20.948Z","1.0.9":"2025-09-16T17:52:22.375Z","1.1.0":"2025-10-31T17:53:58.236Z","1.1.1":"2025-11-11T20:39:32.474Z","1.1.2":"2025-11-12T20:39:24.155Z","1.1.3":"2025-11-14T21:11:41.142Z","1.1.4":"2025-11-19T16:45:04.001Z","2.0.0":"2025-11-25T19:12:08.016Z","2.0.1":"2025-11-25T19:47:18.990Z","2.0.2":"2025-11-30T17:56:56.056Z","2.0.3":"2025-12-03T18:26:42.716Z","2.0.4":"2025-12-03T19:10:32.434Z","2.0.5":"2025-12-06T17:54:52.491Z","2.0.6":"2026-02-09T20:13:28.852Z"},"bugs":{"url":"https://github.com/DropInBlog/nextjs-rendered/issues"},"author":{"name":"DropInBlog"},"license":"ISC","homepage":"https://github.com/DropInBlog/nextjs-rendered#readme","keywords":["dropinblog","react","nextjs","component","blog"],"repository":{"url":"git+https://github.com/DropInBlog/nextjs-rendered.git","type":"git"},"description":"DropInBlog rendered content for Next.js projects.","maintainers":[{"email":"jason@dropinblog.com","name":"jason18505"},{"email":"jesse@dropinblog.com","name":"schoberg"}],"readme":"# @dropinblog/nextjs-rendered\n\n> **⚠️ DEPRECATED:** This package is deprecated. Please use [@dropinblog/react-nextjs](https://github.com/DropInBlog/react-nextjs) instead.\n\n[![npm version](https://img.shields.io/npm/v/%40dropinblog%2Fnextjs-rendered.svg)](https://www.npmjs.com/package/@dropinblog/nextjs-rendered) [![npm downloads](https://img.shields.io/npm/dm/%40dropinblog%2Fnextjs-rendered.svg)](https://www.npmjs.com/package/@dropinblog/nextjs-rendered) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE)\n\nAn easy-to-use package for integrating [DropInBlog](https://dropinblog.com/) in Next.js applications. This package provides a seamless way to fetch and display your DropInBlog content with full SEO support and React component integration.\n\n## Features\n\n- Fetch and render DropInBlog content in Next.js apps\n- SEO ready: helpers to generate Next.js metadata from API responses\n- Pagination for main list, categories, and authors\n- XML sitemap\n- RSS feeds\n\n## Getting Started\n\n### Prerequisites\n\nBefore using this package, you'll need:\n\n1. A [DropInBlog](https://dropinblog.com/) account\n2. Your DropInBlog API token and blog ID\n3. A Next.js project (version 13 or higher recommended)\n\n### Installation\n\nInstall the package using npm:\n\n```sh\nnpm install @dropinblog/nextjs-rendered\n```\n\nOr using yarn:\n\n```sh\nyarn add @dropinblog/nextjs-rendered\n```\n\nOr using pnpm:\n\n```sh\npnpm add @dropinblog/nextjs-rendered\n```\n\n### Environment variables\n\nCreate a .env.local file in the root of your Next.js project and add your DropInBlog credentials:\n\n```env\nDROPINBLOG_TOKEN=your_api_token_here\nDROPINBLOG_BLOG_ID=your_blog_id_here\n```\n\nNotes:\n\n- Do not commit .env.local to version control.\n- In Vercel or other hosting, set these as environment variables in the dashboard.\n\n## Usage\n\n### 1. Setup Your API Client\n\nFile: lib/dib.ts\n\n```ts\nimport DibApi from '@dropinblog/api-client';\n\nexport const dibApi = new DibApi(\n  process.env.DROPINBLOG_TOKEN!, // Your DropInBlog API token\n  process.env.DROPINBLOG_BLOG_ID! // Your DropInBlog blog ID\n);\n```\n\n### 2. Configure Your Routes\n\n**Main Blog Page:**\n\nFile: app/blog/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async () =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchMainList);\n\nexport default async function BlogPage() {\n  const { body_html, head_data } = await dibApi.fetchMainList();\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\nFile: app/blog/page/[page]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { page: string };\n}) =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchMainList, {\n    pagination: params.page,\n  });\n\nexport default async function BlogPagePaginated({\n  params,\n}: {\n  params: { page: string };\n}) {\n  const { body_html, head_data } = await dibApi.fetchMainList({\n    pagination: params.page,\n  });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\n**Single Post Page:**\n\nFile: app/blog/[slug]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { slug: string };\n}) => dibUtils.generateMetadataFromFetcher(dibApi.fetchPost, params);\n\nexport default async function BlogPost({\n  params,\n}: {\n  params: { slug: string };\n}) {\n  const { slug } = params;\n  const { body_html, head_data } = await dibApi.fetchPost({ slug });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\n**Category Pages (with pagination):**\n\nFile: app/blog/category/[slug]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\n// Route: /blog/category/[slug]\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { slug: string };\n}) =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchCategories, {\n    slug: params.slug,\n  });\n\nexport default async function CategoryPage({\n  params,\n}: {\n  params: { slug: string };\n}) {\n  const { body_html, head_data } = await dibApi.fetchCategories({\n    slug: params.slug,\n  });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\nFile: app/blog/category/[slug]/page/[page]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { slug: string; page: string };\n}) =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchCategories, {\n    slug: params.slug,\n    pagination: params.page,\n  });\n\nexport default async function CategoryPagePaginated({\n  params,\n}: {\n  params: { slug: string; page: string };\n}) {\n  const { body_html, head_data } = await dibApi.fetchCategories({\n    slug: params.slug,\n    pagination: params.page,\n  });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\n**Author Pages (with pagination):**\n\nFile: app/blog/author/[slug]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { slug: string };\n}) =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchAuthor, {\n    slug: params.slug,\n  });\n\nexport default async function AuthorPage({\n  params,\n}: {\n  params: { slug: string };\n}) {\n  const { body_html, head_data } = await dibApi.fetchAuthor({\n    slug: params.slug,\n  });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\nFile: app/blog/author/[slug]/page/[page]/page.tsx\n\n```tsx\nimport { dibApi } from '@/lib/dib';\nimport { DibBlog, dibUtils } from '@dropinblog/nextjs-rendered';\n\nexport const generateMetadata = async ({\n  params,\n}: {\n  params: { slug: string; page: string };\n}) =>\n  dibUtils.generateMetadataFromFetcher(dibApi.fetchAuthor, {\n    slug: params.slug,\n    pagination: params.page,\n  });\n\nexport default async function AuthorPagePaginated({\n  params,\n}: {\n  params: { slug: string; page: string };\n}) {\n  const { body_html, head_data } = await dibApi.fetchAuthor({\n    slug: params.slug,\n    pagination: params.page,\n  });\n  return <DibBlog body_html={body_html} head_data={head_data} />;\n}\n```\n\n**Sitemap**\n\nFile: app/blog/sitemap.ts\n\n```ts\nimport { dibApi } from '@/lib/dib';\nimport { MetadataRoute } from 'next';\n\nexport default async function sitemap(): Promise<MetadataRoute.Sitemap> {\n  try {\n    const data = await dibApi.fetchSitemap();\n\n    const urlRegex = /<url>([\\s\\S]*?)<\\/url>/g;\n    const locRegex = /<loc>(.*?)<\\/loc>/;\n    const lastmodRegex = /<lastmod>(.*?)<\\/lastmod>/;\n\n    const urls: MetadataRoute.Sitemap = [];\n    const matches = data?.sitemap?.match(urlRegex) || [];\n\n    if (!matches.length) {\n      return urls;\n    }\n\n    for (const urlBlock of matches) {\n      const locMatch = urlBlock.match(locRegex);\n      const lastmodMatch = urlBlock.match(lastmodRegex);\n\n      if (locMatch) {\n        urls.push({\n          url: locMatch[1],\n          lastModified: lastmodMatch ? lastmodMatch[1] : undefined,\n        });\n      }\n    }\n\n    return urls;\n  } catch (error) {\n    return [];\n  }\n}\n```\n\n**Feeds**\n\nFile: app/api/dib/feed/route.ts\n\n```ts\nimport { dibApi } from '@/lib/dib';\nimport { NextResponse } from 'next/server';\n\nexport async function GET() {\n  try {\n    const data = await dibApi.fetchBlogFeed();\n    const headers: HeadersInit = {};\n    if (data.content_type) {\n      headers['Content-Type'] = data.content_type;\n    }\n\n    return new NextResponse(data.feed, {\n      headers,\n    });\n  } catch (error) {\n    return NextResponse.json(\n      { error: 'Failed to fetch blog feed' },\n      { status: 500 }\n    );\n  }\n}\n```\n\n## Requirements\n\n- Node.js 18+\n- Next.js 13+\n\n## Contributing\n\nIssues and PRs are welcome! Please file bugs and feature requests on the GitHub repo and include as much detail as possible.\n\n## License\n\nISC\n\n## Links\n\n- [DropInBlog Website](https://dropinblog.com/)\n- [DropInBlog API Documentation](https://dropinblog.readme.io/reference/api-reference)\n- [GitHub Repository](https://github.com/DropInBlog/nextjs-rendered)\n- [npm Package](https://www.npmjs.com/package/@dropinblog/nextjs-rendered)\n","readmeFilename":"README.md"}