This is a Next.js project using the Optimizely Content JS SDK, running locally and deployable to the Optimizely Frontend Hosting.
-
Copy the
.env.templatefile to.envand add the necessary values from the CMS and optionally your frontend hosting (PaaS Portal). -
Push types
npm run cms:push-config-
Do a full Graph Indexing in Settings in the CMS
-
Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
- Add a new application in Settings > Applications
Add localhost:3000 as the host, use all for languages. You should now have a working start page (a Blank Experience)
To learn more about Optimizely Content JS SDK:
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
The easiest way to deploy is using the deploy.ps1 PowerShell script in the root of the project. It will package up the necessary files and deploy using the Optimizely Deployment API.
Make sure all the environment variables are set.