JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1258
  • Score
    100M100P100Q113570F
  • License Apache-2.0

JavaScript tools for integration with Optimizely CMS

Package Exports

  • @optimizely/cms-sdk
  • @optimizely/cms-sdk/buildConfig
  • @optimizely/cms-sdk/react/client
  • @optimizely/cms-sdk/react/nextjs
  • @optimizely/cms-sdk/react/richText
  • @optimizely/cms-sdk/react/server
  • @optimizely/cms-sdk/telemetry

Readme

@optimizely/cms-sdk

npm version

The official JavaScript/TypeScript SDK for building headless applications with Optimizely CMS. This library provides everything you need to fetch, render, and manage content from Optimizely CMS with full type safety and intelligent code completion.

Features

  • Type-safe content modeling - Full TypeScript definitions for your content types
  • Framework integration - First-class support for React and Next.js
  • Live preview - Real-time content editing experience
  • Rich text rendering - Advanced rich text component with extensibility
  • DAM integration - Seamless digital asset management

Installation

npm install @optimizely/cms-sdk

Or using other package managers:

# pnpm
pnpm add @optimizely/cms-sdk

# yarn
yarn add @optimizely/cms-sdk

Quick Start

// Initialize the client
const client = new GraphClient('<YOUR_APP_SINGLE_KEY>', {
  graphUrl: 'https://your-cms-instance.com',
});

// Fetch content
const c = await client.getContentByPath(`/<SOME_URL>`);

Documentation

Full guides and documentation in the main repository:

Getting Started

  • Installation - Set up your development environment
  • Setup - Configure the SDK and CLI
  • Modelling - Define your content types with TypeScript

Core Features

Advanced Features

Best Practices

This SDK works best when used with the @optimizely/cms-cli package, which enables code-first content modeling by syncing your TypeScript definitions to Optimizely CMS.

npm install -D @optimizely/cms-cli

For complete setup instructions, see the main repository README.

Support

License

Apache License 2.0


Built by the Optimizely CMS Team | Documentation | GitHub