Saltearse al contenido

schemas/plugins

Esta página aún no está disponible en tu idioma.

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:299^

Interface representing the base hooks for plugins in the StudioCMS system.

studiocms:astro:config: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:300^

studiocms:config:setup: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables?: string[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems?: GridItemInput[];
dashboardPages?: {
admin?: (
| {
description: ...;
icon?: ...;
pageActionsComponent?: ...;
pageBodyComponent: ...;
requiredPermissions?: ...;
route: ...;
sidebar: ...;
title: ...;
}
| {
description: ...;
icon?: ...;
innerSidebarComponent: ...;
pageActionsComponent?: ...;
pageBodyComponent: ...;
requiredPermissions?: ...;
route: ...;
sidebar: ...;
title: ...;
})[];
user?: (
| {
description: ...;
icon?: ...;
pageActionsComponent?: ...;
pageBodyComponent: ...;
requiredPermissions?: ...;
route: ...;
sidebar: ...;
title: ...;
}
| {
description: ...;
icon?: ...;
innerSidebarComponent: ...;
pageActionsComponent?: ...;
pageBodyComponent: ...;
requiredPermissions?: ...;
route: ...;
sidebar: ...;
title: ...;
})[];
};
settingsPage?: {
endpoint: string;
fields: (
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultChecked?: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
size?: ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "input";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultValue?: ... | ...;
direction?: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ...;
}
| {
alignCenter?: ... | ... | ...;
fields: ...[];
gapSize?: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
})[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks?: {
href: string;
label: string;
}[];
}]) => void;
setImageService: (...args: [{
imageService?: {
identifier: string;
servicePath: string | URL;
};
}]) => void;
setRendering: (...args: [{
pageTypes?: {
apiEndpoint?: string;
description?: string;
fields?: (... | ... | ... | ... | ... | ...)[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps?: {
pluginName: string;
sitemapXMLEndpointPath: string | URL;
}[];
triggerSitemap?: boolean;
}]) => void;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:301^


Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:304^

hooks: {
studiocms:astro:config?: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;
studiocms:config:setup?: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables?: ...[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems?: GridItemInput[];
dashboardPages?: {
admin?: ... | ...;
user?: ... | ...;
};
settingsPage?: {
endpoint: string;
fields: ...[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks?: {
href: ...;
label: ...;
}[];
}]) => void;
setImageService: (...args: [{
imageService?: {
identifier: string;
servicePath: ... | ...;
};
}]) => void;
setRendering: (...args: [{
pageTypes?: {
apiEndpoint?: ...;
description?: ...;
fields?: ...;
identifier: ...;
label: ...;
pageContentComponent?: ...;
rendererComponent?: ...;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps?: {
pluginName: ...;
sitemapXMLEndpointPath: ...;
}[];
triggerSitemap?: boolean;
}]) => void;
}>;
} & Partial<Record<string, unknown>>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:330^

optional studiocms:astro:config: PluginHook<{
addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void;
logger: AstroIntegrationLogger;
}>;
optional studiocms:config:setup: PluginHook<{
logger: AstroIntegrationLogger;
setAuthService: (...args: [{
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables?: ...[];
svg: string;
};
}]) => void;
setDashboard: (...args: [{
dashboardGridItems?: GridItemInput[];
dashboardPages?: {
admin?: ... | ...;
user?: ... | ...;
};
settingsPage?: {
endpoint: string;
fields: ...[];
};
}]) => void;
setFrontend: (...args: [{
frontendNavigationLinks?: {
href: ...;
label: ...;
}[];
}]) => void;
setImageService: (...args: [{
imageService?: {
identifier: string;
servicePath: ... | ...;
};
}]) => void;
setRendering: (...args: [{
pageTypes?: {
apiEndpoint?: ...;
description?: ...;
fields?: ...;
identifier: ...;
label: ...;
pageContentComponent?: ...;
rendererComponent?: ...;
}[];
}]) => void;
setSitemap: (...args: [{
sitemaps?: {
pluginName: ...;
sitemapXMLEndpointPath: ...;
}[];
triggerSitemap?: boolean;
}]) => void;
}>;

identifier: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:308^

The identifier of the plugin, usually the package name.

name: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:312^

The name of the plugin, displayed in the StudioCMS Dashboard.

optional requires: string[];

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:329^

List of plugins that this plugin requires to function correctly. This is used to ensure that all required plugins are loaded before this plugin. If any required plugin is not found, this plugin will not be loaded. This is an optional field.

["@studiocms/plugin-example", "@studiocms/plugin-another-example"]

studiocmsMinimumVersion: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:321^

The minimum version of StudioCMS required for this plugin to function correctly. This is used to ensure compatibility between the plugin and the StudioCMS core. It should be a semantic version string (e.g., “1.0.0”). If the plugin is not compatible with the current version of StudioCMS, it should not be loaded. This is a required field.

"1.0.0"

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:292^

optional studiocms:plugins: PluginHook<{
exposePlugins: (...args: [
| undefined
| StudioCMSPlugin[]]) => void;
}>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:293^

type HookParameters<Hook, Fn> = Fn extends (...args: any) => any ? Parameters<Fn>[0] : never;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:335^

Hook extends keyof StudioCMSPlugin["hooks"]

Fn = StudioCMSPlugin["hooks"][Hook]


type ImageServiceExtraProps = {
alt: string;
height: number;
width: number;
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:362^

alt: string;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:363^

height: number;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:365^

width: number;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:364^


type SafePluginListItemType = {
frontendNavigationLinks?: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes?: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ...;
defaultChecked?: ...;
input: ...;
label: ...;
name: ...;
readOnly?: ...;
required?: ...;
size?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
}
| {
color?: ...;
defaultValue?: ...;
direction?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly?: ...;
required?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];
settingsPage?: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
};
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:341^

A schema for a safe plugin list item in StudioCMS. This schema omits certain properties from the StudioCMSPluginSchema:

  • integration
  • studiocmsMinimumVersion
  • sitemaps
  • dashboardGridItems
  • triggerSitemap

These properties are excluded to ensure that the plugin list item schema only includes the necessary and safe properties for use in the application.

optional frontendNavigationLinks: {
href: string;
label: string;
}[];

Navigation Links for use with the @studiocms/frontend package to display links in the frontend

identifier: string;

Identifier of the plugin from the package.json

name: string;

Label of the plugin to be displayed in the StudioCMS Dashboard

optional pageTypes: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ...;
defaultChecked?: ...;
input: ...;
label: ...;
name: ...;
readOnly?: ...;
required?: ...;
size?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
}
| {
color?: ...;
defaultValue?: ...;
direction?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly?: ...;
required?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];

Page Type definition. If this is present, the plugin wants to be able to modify the page creation process

optional settingsPage: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
};

If this exists, the plugin will have its own setting page

endpoint: string;

The endpoint for the settings

Should export a APIRoute named onSave that runs when the settings page is saved

fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];

Fields according to specification


type SafePluginListType = {
frontendNavigationLinks?: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes?: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];
settingsPage?: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultChecked?: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
size?: ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "input";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultValue?: ... | ...;
direction?: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
};
}[];

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:342^

optional frontendNavigationLinks: {
href: string;
label: string;
}[];

Navigation Links for use with the @studiocms/frontend package to display links in the frontend

identifier: string;

Identifier of the plugin from the package.json

name: string;

Label of the plugin to be displayed in the StudioCMS Dashboard

optional pageTypes: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (... | ... | ... | ... | ...)[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];

Page Type definition. If this is present, the plugin wants to be able to modify the page creation process

optional settingsPage: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultChecked?: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
size?: ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "input";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultValue?: ... | ...;
direction?: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
};

If this exists, the plugin will have its own setting page

endpoint: string;

The endpoint for the settings

Should export a APIRoute named onSave that runs when the settings page is saved

fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultChecked?: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
size?: ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "input";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
color?: ... | ... | ... | ... | ... | ... | ...;
defaultValue?: ... | ...;
direction?: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
}
| {
defaultValue?: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder?: ... | ...;
readOnly?: ... | ... | ...;
required?: ... | ... | ...;
type?: ... | ... | ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];

Fields according to specification


type SCMSAuthServiceFnOpts = {
oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables?: string[];
svg: string;
};
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:257^

oAuthProvider: {
endpointPath: string;
formattedName: string;
name: string;
requiredEnvVariables?: string[];
svg: string;
};
endpointPath: string;

The path to the endpoint file that handles the OAuth authentication for this provider. This should be a string or URL pointing to the endpoint ts file.

Note: The endpoint should export two functions:

  • initSession: Initializes the session for the OAuth provider.
  • initCallback: Handles the callback from the OAuth provider after authentication.
`/src/auth/providers/google.ts`
formattedName: string;

The formatted name of the OAuth provider, e.g., ‘Google’, ‘GitHub’, etc.

name: string;

The name of the OAuth provider, e.g., ‘google’, ‘github’, etc.

optional requiredEnvVariables: string[];

Required environment variables for the OAuth provider. This is an optional array of strings that specifies which environment variables are required for the OAuth provider to function correctly. If specified, these variables must be set in the environment for the OAuth provider to work.

svg: string;

The inline SVG image for the OAuth provider button. This should be a string containing the SVG markup.

Note: Please ensure the class oauth-logo is included in the SVG for styling purposes.

`<svg width="24px" height="24px" viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg" class="oauth-logo">...</svg>`,

type SCMSDashboardFnOpts = {
dashboardGridItems?: GridItemInput[];
dashboardPages?: {
admin?: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[];
user?: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[];
};
settingsPage?: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
};
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:253^

optional dashboardGridItems: GridItemInput[];

Allows the plugin to add custom dashboard grid items

optional dashboardPages: {
admin?: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[];
user?: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[];
};

Dashboard Pages for the plugin

optional admin: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[] = dashboardPagesArray;

Pages for the editor role

These are shown in the “Admin” section of the dashboard sidebar

optional user: (
| {
description: string;
icon?: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "single";
title: Record<string, string>;
}
| {
description: string;
icon?: string;
innerSidebarComponent: string;
pageActionsComponent?: string;
pageBodyComponent: string;
requiredPermissions?: "owner" | "admin" | "editor" | "visitor" | "none";
route: string;
sidebar: "double";
title: Record<string, string>;
})[] = dashboardPagesArray;

Pages for the user role

These are shown in the “Dashboard” section of the dashboard sidebar

optional settingsPage: {
endpoint: string;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
} = SettingsPageSchema;

If this exists, the plugin will have its own setting page

endpoint: string;

The endpoint for the settings

Should export a APIRoute named onSave that runs when the settings page is saved

fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: boolean;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ...;
label: ...;
value: ...;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];

Fields according to specification


type SCMSFrontendFnOpts = {
frontendNavigationLinks?: {
href: string;
label: string;
}[];
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:254^

optional frontendNavigationLinks: {
href: string;
label: string;
}[] = FrontendNavigationLinksSchema;

Navigation Links for use with the @studiocms/frontend package to display links in the frontend


type SCMSImageServiceFnOpts = {
imageService?: {
identifier: string;
servicePath: string | URL;
};
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:256^

optional imageService: {
identifier: string;
servicePath: string | URL;
};
identifier: string;

Identifier used for the preferredImageService setting on StudioCMS

servicePath: string | URL;

The Service Path to the file that contains your service, the service must be exported as a default export.

For an example of a service, checkout /src/imageServices/cloudinary-js-service.ts and its plugin /src/imageServices/cloudinary-js.ts within the StudioCMS package on GitHub.


type SCMSRenderingFnOpts = {
pageTypes?: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ...;
defaultChecked?: ...;
input: ...;
label: ...;
name: ...;
readOnly?: ...;
required?: ...;
size?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
}
| {
color?: ...;
defaultValue?: ...;
direction?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly?: ...;
required?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[];
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:255^

optional pageTypes: {
apiEndpoint?: string;
description?: string;
fields?: (
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultChecked?: boolean;
input: "checkbox";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
size?: "md" | "sm" | "lg";
}
| {
defaultValue?: string;
input: "input";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "number" | "password" | "url" | "text" | "email" | "tel" | "search";
}
| {
defaultValue?: string;
input: "textarea";
label: string;
name: string;
placeholder?: string;
readOnly?: boolean;
required?: boolean;
}
| {
color?: "primary" | "success" | "warning" | "danger" | "info" | "mono";
defaultValue?: string;
direction?: "horizontal" | "vertical";
input: "radio";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
readOnly?: boolean;
required?: boolean;
}
| {
defaultValue?: string;
input: "select";
label: string;
name: string;
options: {
disabled?: ... | ... | ...;
label: string;
value: string;
}[];
placeholder?: string;
readOnly?: boolean;
required?: boolean;
type?: "search" | "basic";
}
| {
alignCenter?: boolean;
fields: (
| {
color?: ...;
defaultChecked?: ...;
input: ...;
label: ...;
name: ...;
readOnly?: ...;
required?: ...;
size?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
}
| {
color?: ...;
defaultValue?: ...;
direction?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
readOnly?: ...;
required?: ...;
}
| {
defaultValue?: ...;
input: ...;
label: ...;
name: ...;
options: ...;
placeholder?: ...;
readOnly?: ...;
required?: ...;
type?: ...;
})[];
gapSize?: "md" | "sm" | "lg";
input: "row";
label: string;
name: string;
readOnly?: boolean;
required?: boolean;
})[];
identifier: string;
label: string;
pageContentComponent?: string;
rendererComponent?: string;
}[] = PageTypesSchema;

Page Type definition. If this is present, the plugin wants to be able to modify the page creation process


type SCMSSiteMapFnOpts = {
sitemaps?: {
pluginName: string;
sitemapXMLEndpointPath: string | URL;
}[];
triggerSitemap?: boolean;
};

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:252^

optional sitemaps: {
pluginName: string;
sitemapXMLEndpointPath: string | URL;
}[];

Allows the plugin to add sitemap endpoints

optional triggerSitemap: boolean;

If this is true, the plugin will enable the Sitemap


type StudioCMSImageService = (src: string, props: ImageServiceExtraProps) => string | Promise<string>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:368^

string

ImageServiceExtraProps

string | Promise<string>

const SafePluginListItemSchema: ZodObject<SafePluginListItemType>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:66^

A schema for a safe plugin list item in StudioCMS. This schema omits certain properties from the StudioCMSPluginSchema:

  • integration
  • studiocmsMinimumVersion
  • sitemaps
  • dashboardGridItems
  • triggerSitemap

These properties are excluded to ensure that the plugin list item schema only includes the necessary and safe properties for use in the application.


const SafePluginListSchema: ZodArray<SafePluginListType>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:93^


const StudioCMSSanitizeOptionsSchema: ZodOptional<ZodObject<{
allowAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
allowComments: ZodOptional<ZodBoolean>;
allowComponents: ZodOptional<ZodBoolean>;
allowCustomElements: ZodOptional<ZodBoolean>;
allowElements: ZodOptional<ZodArray<ZodString, "many">>;
blockElements: ZodOptional<ZodArray<ZodString, "many">>;
dropAttributes: ZodOptional<ZodRecord<ZodString, ZodArray<ZodString, "many">>>;
dropElements: ZodOptional<ZodArray<ZodString, "many">>;
}, "strip", ZodTypeAny, {
allowAttributes?: Record<string, string[]>;
allowComments?: boolean;
allowComponents?: boolean;
allowCustomElements?: boolean;
allowElements?: string[];
blockElements?: string[];
dropAttributes?: Record<string, string[]>;
dropElements?: string[];
}, {
allowAttributes?: Record<string, string[]>;
allowComments?: boolean;
allowComponents?: boolean;
allowCustomElements?: boolean;
allowElements?: string[];
blockElements?: string[];
dropAttributes?: Record<string, string[]>;
dropElements?: string[];
}>>;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:29^

Schema for options used to sanitize HTML content in StudioCMS.

This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.

function definePlugin(options: StudioCMSPlugin): StudioCMSPlugin;

Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:358^

Defines a plugin for StudioCMS.

StudioCMSPlugin

The configuration options for the plugin.

StudioCMSPlugin

The plugin configuration.

Re-exports AvailableDashboardPages


Re-exports DashboardPage


Re-exports FinalDashboardPage


Re-exports SettingsField


Re-exports StudioCMSColorway