1. Sitecore Content SDK

Plugins

Version:

Plugins are modular components that extend the Content SDK with specific functionality. Each plugin encapsulates a particular capability like events or personalization, and can declare dependencies on other plugins. Due to their modular nature, you can include the exact functionality you need. They’re type-safe with full TypeScript support and proper type inference. Plugins are also declarative providing clear dependency management between different plugins. See Initializing tracking, events, and personalization in the Content SDK for more information.

The interface for a plugin is as shown:

export interface Plugin<Options = unknown, Adapter = unknown> {
  name: string;
  options?: Options;
  dependencies?: PluginDependency[];
  init?: () => void | Promise<void>;
  adapter?: Adapter;
}

Field

Description

name

Name of the plugin.

options

Options specific to the plugin.

dependencies

Plugins can declare dependencies on other plugins by using the dependencies field. This allows the SDK to ensure that required capabilities are present and initialized before a dependent plugin runs.

init()

Initialization function run once when init is called for the first time. Can be async also.

adapter

Optional adapter used for specifying environment requirements explicitly in a type‑safe way.

Available plugins

The following plugins and their corresponding capabilities are available out of the box:

Plugin

Purpose

Package

analyticsPlugin()

It is required for the events and personalization plugins to function correctly. Provides core client ID handling a shared analytics initialization logic. When used on its own, you get stable visitor identification, but no event tracking or personalization.

@sitecore-content-sdk/analytics-core

eventsPlugin()

Adds the ability to track page view and/or custom events with the underlying client ID logic.

@sitecore-content-sdk/events

personalizeBrowserPlugin() or personalizeServerPlugin()

Add support for personalization, enabled via the the personalization cookie, with optional web personalization. It relies on the base analytics plugin to handle visitor identification and cookie settings. The browser plugin should be used in client-side contexts, while the server plugin is suited for server components or a Next JS middleware/proxy context.

@sitecore-content-sdk/personalize

If you have suggestions for improving this article, let us know!