Diggama Logo
Integration

Diggama + Next.js

Build blazing-fast React applications with Next.js and structured content from Diggama. SSR, SSG, and ISR supported.

Static Generation

Pre-render pages at build time with getStaticProps. Lightning-fast load times.

Server Rendering

Fetch fresh content on every request with getServerSideProps for dynamic pages.

Incremental Regen

Update static pages without full rebuilds using ISR. Best of both worlds.

pages/blog/[slug].tsx
import { diggama } from '@diggama/client'

export async function getStaticProps({ params }) {
  const post = await diggama.content
    .type('blog-post')
    .filter({ slug: params.slug })
    .first()

  return { props: { post }, revalidate: 60 }
}

export async function getStaticPaths() {
  const posts = await diggama.content
    .type('blog-post')
    .all()

  return {
    paths: posts.map(p => ({ params: { slug: p.slug } })),
    fallback: 'blocking'
  }
}

export default function BlogPost({ post }) {
  return (
    <article>
      <h1>{post.title}</h1>
      <div dangerouslySetInnerHTML={{ __html: post.content }} />
    </article>
  )
}

Integration Features

Webhook Deploys

Trigger rebuilds when content changes. Works with Vercel, Netlify, and more.

Preview Mode

Preview draft content before publishing with Next.js preview mode.

Image Optimization

Use next/image with Diggama's image CDN for optimized delivery.

TypeScript Support

Full type definitions for content models. Catch errors at compile time.

Start building with Next.js

Get started with our Next.js starter template and documentation.

Need help with Next.js?

Our team can help you set up Diggama with your Next.js project.