Contentful Personalization & Analytics
    Preparing search index...

    Contentful Logo

    Contentful Personalization & Analytics

    Optimization SDK Suite

    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-core is the shared foundation for runtime adapters and SDK layering.
    • @contentful/optimization-api-client and @contentful/optimization-api-schemas are 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.

    • packages/: published SDKs and supporting libraries
    • implementations/: reference applications used for examples and E2E coverage
    • lib/: shared internal workspace packages such as mocks and build tooling
    • documentation/: authored supporting documentation published alongside TypeDoc
    • docs/: 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.

    Read our full Code of Conduct.