Skip to main content

Configuration

Complete reference for all PexelizeConfig / EditorOptions properties passed when initializing the editor.

Initialization Options

These are the top-level properties passed to pexelize.init() or the framework component:

OptionTypeRequiredDefaultDescription
containerIdstringYesThe DOM element ID to mount the editor.
editorKeystringYesEditor key for authentication (from the Pexelize Dashboard). Starts with px_.
editorMode'email' | 'web' | 'popup'No'email'Builder mode.
designMode'edit' | 'live'No'live'Admin vs end-user permissions.
designDesignJson | nullNoInitial design to load.
popupPopupConfigNoPopup builder configuration (required when editorMode is 'popup').
callbacksPexelizeCallbacksNo{}Lifecycle and action callbacks. See Callbacks.
optionsEditorOptionsNo{}All editor configuration (see below).

Editor Options

These are nested under options in the SDK's PexelizeConfig:

OptionTypeRequiredDefaultDescription
userUserConfigYesCurrent user identity.
localestringNo'en'BCP-47 locale for the editor UI (e.g. 'fr', 'de', 'ja').
translationsRecord<string, Record<string, string>>No{}Custom translation overrides keyed by locale.
textDirection'ltr' | 'rtl'No'ltr'Text direction for the editor UI and content.
mergeTagsMergeTag[]No[]Dynamic merge tags available in the text editor (e.g. {{first_name}}).
designTagsRecord<string, string>No{}Key/value pairs replaced in HTML at export time.
specialLinksSpecialLink[]No[]Custom link types shown in the link picker (e.g. unsubscribe, view-in-browser).
modulesModule[]No[]Reusable content modules available in the content panel.
displayConditionsDisplayCondition[]No[]Conditions users can apply to rows for conditional rendering.
appearanceAppearanceConfigNo{}Theme, accent color, and layout settings.
toolsToolsConfigNo{}Show, hide, or lock individual content tools.
customToolsCustomTool[]No[]Register custom content tools.
fontsFontDefinition[]No[]Custom fonts available in the editor.
bodyValuesBodyValuesNo{}Default body-level values (background color, content width, font family).
headerDesignJsonNoLocked header row rendered above the editable area.
footerDesignJsonNoLocked footer row rendered below the editable area.
editorEditorConfigNo{}Editor behavior settings.
featuresFeaturesConfigNo{}Enable/disable editor features.
assetStorageAssetStorageConfigNoImage/file upload configuration.
aiAIConfigNo{ mode: 'disabled' }AI feature configuration. See AI Overview.
callbacksPexelizeCallbacksNo{}Lifecycle and action callbacks. See Callbacks.

UserConfig

interface UserConfig {
id: string;
name: string;
email: string;
avatar?: string; // URL to avatar image
}

AppearanceConfig

OptionTypeDefaultDescription
theme'light' | 'dark''light'Editor color theme.
accentColorAccentColor'#4f46e5'Accent color for buttons and highlights.
layout'full' | 'compact''full'Editor layout mode.
panelsPanelConfig{}Show/hide specific panels (content, blocks, settings).
borderRadius'none' | 'sm' | 'md' | 'lg''md'Border radius for editor UI elements.

ToolsConfig

Controls visibility and behavior of content tools in the sidebar:

interface ToolsConfig {
text?: ToolConfig;
image?: ToolConfig;
button?: ToolConfig;
divider?: ToolConfig;
spacer?: ToolConfig;
social?: ToolConfig;
video?: ToolConfig;
html?: ToolConfig;
heading?: ToolConfig;
menu?: ToolConfig;
timer?: ToolConfig;
}

interface ToolConfig {
enabled?: boolean; // show/hide the tool (default: true)
locked?: boolean; // prevent user from modifying tool properties (default: false)
properties?: Record<string, {
enabled?: boolean;
locked?: boolean;
defaultValue?: any;
}>;
}

EditorConfig

OptionTypeDefaultDescription
minRowsnumber1Minimum number of rows in the design.
maxRowsnumberInfinityMaximum number of rows allowed.
autoSavebooleanfalseEnable auto-save (fires the autoSave event).
autoSaveIntervalnumber30000Auto-save interval in milliseconds.
modeEditorMode'email'Editor mode: 'email' or 'web'.

FeaturesConfig

OptionTypeDefaultDescription
previewbooleantrueShow/hide the preview button.
undobooleantrueEnable undo/redo.
stockImagesbooleantrueEnable stock image browser.
imageUploadbooleantrueEnable image file uploads.
imageEditorbooleantrueEnable built-in image cropping/editing.
modulesbooleantrueEnable saved modules panel.
specialLinksbooleantrueShow special links in link picker.
displayConditionsbooleantrueShow display condition UI on rows.
exportHtmlbooleantrueEnable HTML export.
exportImagebooleantrueEnable image export.
exportPdfbooleantrueEnable PDF export.

AssetStorageConfig

OptionTypeDescription
uploadUrlstringURL to POST image uploads to.
uploadHeadersRecord<string, string>Additional headers sent with upload requests.
onUpload(file: File) => Promise<{ url: string }>Custom upload handler (overrides uploadUrl).
maxFileSizenumberMax file size in bytes (default: 5MB).
acceptedFormatsstring[]Accepted MIME types (default: ['image/png', 'image/jpeg', 'image/gif', 'image/webp']).

AIConfig

OptionTypeDescription
mode'pexelize' | 'external' | 'disabled'AI mode. See AI Overview.
featuresAIFeaturesConfigEnable/disable individual AI features.
callbacksAICallbacksCallback handlers for external mode.

Example: Full Configuration

const config: PexelizeConfig = {
user: { id: '1', name: 'Jane Doe', email: 'jane@example.com' },
locale: 'en',
textDirection: 'ltr',
mergeTags: [
{ name: 'First Name', value: '{{first_name}}' },
{ name: 'Company', value: '{{company}}' },
],
appearance: {
theme: 'light',
accentColor: '#4f46e5',
},
tools: {
html: { enabled: false },
video: { enabled: false },
},
editor: {
mode: 'email',
autoSave: true,
autoSaveInterval: 15000,
},
features: {
exportPdf: false,
},
assetStorage: {
onUpload: async (file) => {
const form = new FormData();
form.append('file', file);
const res = await fetch('/api/upload', { method: 'POST', body: form });
return res.json();
},
},
ai: { mode: 'pexelize' },
};
info

Options not specified use their default values. At the top level, containerId and editorKey are required. Within options, only user is required.