Next.jsReactSaaSStarter

Optimizely-SaaS-CMS-Next.js-15 — Next.js SaaS Template

By szymonuryga

A starter template for Optimizely SaaS CMS and Next.js 15 App Router, including foundational integrations for content fetching, preview, routing, Visual Builder, and cache revalidation.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-03View source

What stands out

A quick read of the recorded project description.

01

Starter template based on Next.js 15 App Router

02

Fetches content via Optimizely Graph and generates types and SDK with GraphQL Codegen

03

Static generation with webhook-triggered on-demand cache revalidation

04

Draft mode for content preview, integrated with Visual Builder

05

Multilingual support with automatic language detection

06

Uses Tailwind CSS and shadcn/ui, with TypeScript code

Template Details

This template is used to integrate Optimizely SaaS CMS within Next.js 15 App Router, covering foundational integrations such as content fetching, preview, routing, Visual Builder, and cache revalidation. Content is fetched via Optimizely Graph, and types and SDK are generated with GraphQL Codegen; pages use static generation with webhook-triggered on-demand cache revalidation, and a draft mode is provided for content preview. The template includes multilingual support with automatic language detection, a Block Factory Mapper for dynamically rendering content blocks, and metadata-based SEO configuration. The UI layer uses Tailwind CSS and shadcn/ui, and the code is TypeScript. The repository root includes ExportedFile.episerverdata, which can be imported into an Optimizely instance to obtain preconfigured content; before importing, the Polish language must be added in CMS settings. The design is intentionally simple and serves only as an example, not targeting specific project visual requirements. Prerequisites are an Optimizely SaaS CMS instance and a Content Graph API key, along with a set of environment variables.

Next.jsSaaSStarter

Is it right for your project?

Use Cases

  • Set up an initial skeleton for a Next.js project that needs to integrate Optimizely SaaS CMS
  • Verify integration approaches for Optimizely Graph content fetching, draft preview, and cache revalidation
  • Implement multilingual routing and content rendering in Next.js 15 App Router
  • Dynamically render Optimizely content blocks via Block Factory Mapper
  • Quickly start development with preconfigured content after importing ExportedFile.episerverdata

Suitable For

  • Developers who already have an Optimizely SaaS CMS instance and a Content Graph API key
  • Projects needing a reference for integrating Next.js 15 App Router with Optimizely SaaS CMS
  • Teams wanting to understand implementation approaches for Optimizely Graph, draft mode, and cache revalidation
  • Developers who accept that the template design is an example and needs visual and structural adjustments per project

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Requires Node.js 18.17 or higher, an Optimizely SaaS CMS instance, and a Content Graph API key

  2. 2

    Create .env in the root directory and configure OPTIMIZELY_API_URL, OPTIMIZELY_SINGLE_KEY, OPTIMIZELY_PREVIEW_SECRET, OPTIMIZELY_REVALIDATE_SECRET, OPTIMIZELY_START_PAGE_URL, NEXT_PUBLIC_CMS_URL

  3. 3

    Run npm install to install dependencies, run npm run gen-types to generate GraphQL types and SDK, then run npm run dev to start the development server

  4. 4

    OPTIMIZELY_START_PAGE_URL must be manually set to the full route URL of the Start Page, because under hierarchical routing the Start Page does not occupy the root path / by default

  5. 5

    Before importing ExportedFile.episerverdata, first add the Polish language in CMS settings, then upload the file via Admin > Tools > Import Data

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in a public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Using this template requires an Optimizely SaaS CMS instance; you need to contact the Optimizely team to obtain CMS access, otherwise content cannot be fetched.
  • Before running, an Optimizely SaaS CMS instance and a Content Graph API key are required, which are external commercial service dependencies.
  • Before importing preconfigured content, the Polish language must first be added in CMS settings, otherwise the import may fail.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

This template requires an Optimizely SaaS CMS instance to retrieve content. Please connect with the [Optimizely](https://www.optimizely.com/products/content-management/) team to receive CMS access.

Original README

An Optimizely SaaS CMS instance - Optimizely Content Graph API key

Original README

Make sure to add "Polish" language in your CMS settings before importing content to ensure successful import

Original README
https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/LICENSEhttps://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 88 / 100
Technologies
Next.js · React
Website type
SaaS · Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2025-12-31
Screenshot last checked
2026-10-03

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-04

Inspect the recorded source material

SHA-256: 2522137ce78c900de23f3fc11613d70ee5219499c2cf6dbe001dc8e1286e2d0a

2026-10-03T08:43:54.359Z

Source file / repository
# Optimizely SaaS CMS + Next.js 15

A comprehensive starter template for building modern websites with Optimizely SaaS CMS and Next.js 15 App Router. This template serves as an excellent starting point for projects integrating with Optimizely SaaS CMS.

This project was built based on a free course on how to get started with Optimizely SaaS CMS. You can find step-by-step information on how this project was built at: https://opti-masterclass.vercel.app

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fszymonuryga%2FOptimizely-SaaS-CMS-Next.js-15&env=OPTIMIZELY_API_URL,OPTIMIZELY_SINGLE_KEY,OPTIMIZELY_PREVIEW_SECRET,OPTIMIZELY_REVALIDATE_SECRET,OPTIMIZELY_START_PAGE_URL,NEXT_PUBLIC_CMS_URL)

> Note: This template requires an Optimizely SaaS CMS instance to retrieve content. Please connect with the [Optimizely](https://www.optimizely.com/products/content-management/) team to receive CMS access.

## Features

- ⚡ **Next.js 15** with App Router
- 🏗️ **Static Site Generation (SSG)** for optimal performance
- 🔄 **On-Demand Cache Revalidation** via webhooks for real-time content updates
- 👁️ **Draft Mode** for content previews
- 🌐 **Multi-language Support** with automatic language detection
- 🧩 **Block Factory Mapper** for dynamic content rendering
- 🎨 **Visual Builder Integration** for intuitive content editing
- 🔍 **SEO Optimized** with metadata support
- 💅 **Tailwind CSS & shadcn/ui** for beautiful, responsive designs
- 📊 **TypeScript** for type safety
- 📝 **GraphQL Codegen** for type-safe API calls

## Important Note

- This repository includes an `ExportedFile.episerverdata` file in the root folder, which contains all initial content for Optimizely SaaS CMS. You can import this file into your Optimizely instance to get started with pre-configured content.
- This template focuses on core functionality that is common to all projects, such as fetching content from Optimizely Graph, preview functionality, routing, Visual Builder and cache revalidation. The design is intentionally simple and serves as an example — each project will have its own design requirements.

## Getting Started

### Prerequisites

- Node.js 18.17 or later
- An Optimizely SaaS CMS instance
- Optimizely Content Graph API key

### Setup Instructions

- Clone the repository:

```bash
git clone https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15.git
cd Optimizely-SaaS-CMS-Next.js-15
```

- Install dependencies:

```shellscript
npm install
```

- Set up environment variables:

Create a `.env` file in the root directory with the following variables:

```plaintext
OPTIMIZELY_API_URL="https://cg.optimizely.com/content/v2"
OPTIMIZELY_SINGLE_KEY=""
OPTIMIZELY_PREVIEW_SECRET=""
OPTIMIZELY_REVALIDATE_SECRET=""
OPTIMIZELY_START_PAGE_URL=""
NEXT_PUBLIC_CMS_URL="https://app-{your-data}.cms.optimizely.com"
```

- Generate GraphQL types and SDK with all methods:

```shellscript
npm run gen-types
```

- Start the development server:

```shellscript
npm run dev
```

- Open [http://localhost:3000](http://localhost:3000) in your browser.

## Documentation

This project includes comprehensive documentation on various aspects of integrating Next.js with Optimizely SaaS CMS:

- [Project Setup](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/project-setup.md) - Basic setup instructions
- [Block Factory Mapper](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/block-factory-mapper.md) - Pattern for dynamically rendering content blocks
- [Fetching Data](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/fetch-data.md) - How to fetch data from Optimizely Graph
- [Cache Revalidation](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/cache-revalidation.md) - Implementing cache revalidation with webhooks
- [Visual Builder](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/visual-builder.md) - Integration with Optimizely's Visual Builder
- [Draft Mode](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/draft-mode.md) - Setting up preview/draft mode
- [Multi-language Support](https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15/blob/main/docs/multi-language.md) - Implementing localization

👉 A complete step-by-step guide and course on how to build everything from scratch can be found here: https://opti-masterclass.vercel.app

## Importing Content to Optimizely

1. Log in to your Optimizely SaaS CMS instance
2. **Important**: Make sure to add "Polish" language in your CMS settings before importing content to ensure successful import
3. Go to Admin > Tools > Import Data
4. Upload the `ExportedFile.episerverdata` file from the root of this project
5. Follow the import wizard to complete the process

## Environment Variables

- `OPTIMIZELY_API_URL`: The base URL for the Optimizely Graph (typically "https://cg.optimizely.com/content/v2")
- `OPTIMIZELY_SINGLE_KEY`: Your Optimizely Content Graph API key
- `OPTIMIZELY_PREVIEW_SECRET`: Generated base64 string based on your AppKey and AppSecret credentials. For more details I recommend you to take a look at Kunal's article: https://kunalshetye.com/posts/optimizely-graph-using-appkey-appsecret/
- `OPTIMIZELY_REVALIDATE_SECRET`: A secret key used for revalidating cached content
- `OPTIMIZELY_START_PAGE_URL`: Defines the full route URL of the Start Page in Optimizely CMS. When using hierarchical routing, Optimizely does not assign the root path `/` to the Start Page by default. Instead, the Start Page must have an explicit URL like "/start-page". This impacts the overall routing logic and cache revalidation mechanisms. Therefore, this variable must be set manually to indicate the correct URL of the Start Page.
- `NEXT_PUBLIC_CMS_URL`: The URL of your SaaS CMS instance

## Future Enhancements

This template is actively maintained and will be updated to support new features and improvements in Optimizely SaaS CMS as they become available. Stay tuned for future enhancements!

## License

[MIT](LICENSE)
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.