Skip to content

Latest commit

 

History

History
68 lines (43 loc) · 1.26 KB

File metadata and controls

68 lines (43 loc) · 1.26 KB

Installation

This page explains how to install the Optimizely SDK and CLI into your project.

  • The SDK is a library with tools to model your content, fetch it and render it
  • The CLI is a terminal app to upload your models to the CMS via the CMS REST API

Using the CLI

You can run the CLI directly without installing it using npx:

npx @optimizely/cms-cli@latest

This will always use the latest version and doesn't require installation. You should see a command list.

Alternative: Install the CLI

Install globally

npm install @optimizely/cms-cli -g

You can test that it worked by running:

optimizely-cms-cli

Install in a project

npm install @optimizely/cms-cli -D

Then use it from the project:

optimizely-cms-cli

Step 1. Initialize a npm project

We recommend to initialize a Next.js project. Run:

npx create-next-app@latest

And select the following prompts:

  • Would you like to use TypeScript: Yes
  • Would you like your code inside a src/ directory? Yes
  • Would you like to use App Router? (recommended) Yes

Step 2. Install the SDK

npm install @optimizely/cms-sdk

Next steps

Now, you are ready to set up the CLI