Readme · Guides · Reference · Contributing
Warning
The Optimization SDK Suite is pre-release (alpha). Breaking changes may be published at any time.
A pnpm monorepo hosting a suite of SDKs, supporting libraries, and reference implementations for Contentful Personalization and Analytics products.
What is Contentful?
Contentful provides content infrastructure for digital teams to power websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enables developers and content creators to ship their products faster.
Table of Contents
If you are deciding which SDK or library belongs in your application, start with Choosing the Right SDK.
For additional narrative documentation, see the Guides section.
Package README files listed below are package-level overviews. Generated reference documentation remains the source of truth for exported API signatures.
The published package surface is intentionally layered. The table below is a package inventory and high-level role summary.
| Package | Kind | Runtime | Role | Package README |
|---|---|---|---|---|
@contentful/optimization-web |
Environment SDK | Browser | Stateful browser SDK for optimization, tracking, and consent | Web SDK |
@contentful/optimization-react-web |
Framework SDK | React on the web | React integration layer on top of the Web SDK | React Web SDK |
@contentful/optimization-node |
Environment SDK | Node.js | Stateless Node SDK for server-side and SSR integrations | Node SDK |
@contentful/optimization-react-native |
Environment SDK | React Native | React Native SDK for mobile applications | React Native SDK |
@contentful/optimization-web-preview-panel |
Tooling package | Browser | Preview tooling package for existing Web SDK instances | Web Preview Panel |
@contentful/optimization-core |
Shared SDK foundation | Runtime-agnostic | Shared optimization foundation for runtime adapters and SDK layers | Core SDK |
@contentful/optimization-api-client |
Universal library | Runtime-agnostic | Direct Experience API and Insights API client library | API Client |
@contentful/optimization-api-schemas |
Universal library | Runtime-agnostic | Validation schemas and inferred API/content types library | API Schemas |
General selection rules:
- Most application code should start with an environment SDK or framework SDK.
@contentful/optimization-coreis the shared foundation for runtime adapters and SDK layering.@contentful/optimization-api-clientand@contentful/optimization-api-schemasare lower-level building blocks.
These packages or layers are planned, but are not currently published from this repository:
- iOS Swift SDK
- Android Kotlin SDK
- Android Java SDK
- Nest.js SDK
- Angular SDK
- Svelte SDK
- Vue SDK
Reference implementations exist to exercise critical flows end to end and to document common usage patterns with intentionally minimal application code.
- Web Vanilla: static browser integration for the Web SDK
- React Web: React-based browser integration
- Node SSR Only: server-rendered integration using the Node SDK
- Node SSR + Web Vanilla: split server/browser flow using Node and Web SDKs together
- React Native: mobile application integration for Android and iOS targets
packages/: published SDKs and supporting librariesimplementations/: reference applications used for examples and E2E coveragelib/: shared internal workspace packages such as mocks and build toolingdocumentation/: authored supporting documentation published alongside TypeDocdocs/: generated TypeDoc output; not source of truth
We appreciate any help on our repositories. For more details about how to contribute see our CONTRIBUTING document.
This repository is published under the MIT license.
We want to provide a safe, inclusive, welcoming, and harassment-free space and experience for all participants, regardless of gender identity and expression, sexual orientation, disability, physical appearance, socioeconomic status, body size, ethnicity, nationality, level of experience, age, religion (or lack thereof), or other identity markers.