A comprehensive starter template for building modern websites with Optimizely SaaS CMS and Next.js 15 App Router.
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
Note: This template requires an Optimizely SaaS CMS instance to retrieve content. Please connect with the Optimizely team to receive CMS access.
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.
git clone https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15.gitcd Optimizely-SaaS-CMS-Next.js-15
npm install
Create a .env
file in the root directory with the following variables:
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"
npm run gen-types
npm run dev
This project includes comprehensive documentation on various aspects of integrating Next.js with Optimizely SaaS CMS:
👉 A complete step-by-step guide and course on how to build everything from scratch can be found here: https://opti-masterclass.vercel.app
ExportedFile.episerverdata
file from the root of this projectOPTIMIZELY_API_URL
: The base URL for the Optimizely Graph (typically "https://cg.optimizely.com/content/v2")OPTIMIZELY_SINGLE_KEY
: Your Optimizely Content Graph API keyOPTIMIZELY_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 contentOPTIMIZELY_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 instanceThis 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!
A comprehensive starter template for building modern websites with Optimizely SaaS CMS and Next.js 15 App Router.
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
Note: This template requires an Optimizely SaaS CMS instance to retrieve content. Please connect with the Optimizely team to receive CMS access.
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.
git clone https://github.com/szymonuryga/Optimizely-SaaS-CMS-Next.js-15.gitcd Optimizely-SaaS-CMS-Next.js-15
npm install
Create a .env
file in the root directory with the following variables:
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"
npm run gen-types
npm run dev
This project includes comprehensive documentation on various aspects of integrating Next.js with Optimizely SaaS CMS:
👉 A complete step-by-step guide and course on how to build everything from scratch can be found here: https://opti-masterclass.vercel.app
ExportedFile.episerverdata
file from the root of this projectOPTIMIZELY_API_URL
: The base URL for the Optimizely Graph (typically "https://cg.optimizely.com/content/v2")OPTIMIZELY_SINGLE_KEY
: Your Optimizely Content Graph API keyOPTIMIZELY_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 contentOPTIMIZELY_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 instanceThis 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!