Contentstack App SDK Rich Text Editor

View as Markdown

Contentstack App SDK Rich Text Editor

The Rich Text Editor (RTE) provides extensibility through plugins and context-based APIs that enable developers to customize editing experiences and interact with entry data.

RTEPlugin

The RTEPlugin function creates custom plugins for the Rich Text Editor.

rtePlugin(id, config)

The rtePlugin method registers a plugin with the RTE system.

import { rtePlugin } from '@contentstack/app-sdk';

rtePlugin('my-plugin', (rte) => {
  return {
    title: 'My Plugin',
    icon: '',
    render: (props) => {
      // Plugin implementation
    }
  };
});

RTELocation

The RTELocation object provides access to the RTE context and entry data within rich text fields.

const rteLocation = sdk.location.RTELocation;
if (rteLocation) {
  const entry = rteLocation.entry;
  const entryData = entry.getData();
}

It supports only the entry core object: