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.
Deploy with the npm script:
npm run deploy-test2This runs opticloud ship to package the app and deploy it to the Test2 environment via the Optimizely Deployment API. The opticloud CLI is the @kunalshetye/opticloud devDependency, so npm install provides it — no global install needed. Packaging respects .zipignore.
Make sure all the environment variables are set.