schemas/plugins
Esta página aún no está disponible en tu idioma.
Interfaces
Section titled “Interfaces”BasePluginHooks
Section titled “BasePluginHooks”Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:299^
Interface representing the base hooks for plugins in the StudioCMS system.
Properties
Section titled “Properties”studiocms:astro:config
Section titled “studiocms:astro:config”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
Section titled “studiocms:config:setup”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^
StudioCMSPlugin
Section titled “StudioCMSPlugin”Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:304^
Properties
Section titled “Properties”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^
Type Declaration
Section titled “Type Declaration”studiocms:astro:config?
Section titled “studiocms:astro:config?”optional studiocms:astro:config: PluginHook<{ addIntegrations: (...args: [AstroIntegration | AstroIntegration[]]) => void; logger: AstroIntegrationLogger;}>;
studiocms:config:setup?
Section titled “studiocms:config:setup?”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
Section titled “identifier”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.
requires?
Section titled “requires?”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.
Example
Section titled “Example”["@studiocms/plugin-example", "@studiocms/plugin-another-example"]
studiocmsMinimumVersion
Section titled “studiocmsMinimumVersion”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.
Example
Section titled “Example”"1.0.0"
StudioCMSPluginHook
Section titled “StudioCMSPluginHook”Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:292^
Properties
Section titled “Properties”studiocms:plugins?
Section titled “studiocms:plugins?”optional studiocms:plugins: PluginHook<{ exposePlugins: (...args: [ | undefined | StudioCMSPlugin[]]) => void;}>;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:293^
Type Aliases
Section titled “Type Aliases”HookParameters
Section titled “HookParameters”type HookParameters<Hook, Fn> = Fn extends (...args: any) => any ? Parameters<Fn>[0] : never;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:335^
Type Parameters
Section titled “Type Parameters”Hook
extends keyof StudioCMSPlugin
["hooks"
]
Fn
= StudioCMSPlugin
["hooks"
][Hook
]
ImageServiceExtraProps
Section titled “ImageServiceExtraProps”type ImageServiceExtraProps = { alt: string; height: number; width: number;};
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:362^
Properties
Section titled “Properties”alt: string;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:363^
height
Section titled “height”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^
SafePluginListItemType
Section titled “SafePluginListItemType”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.
Type Declaration
Section titled “Type Declaration”frontendNavigationLinks?
Section titled “frontendNavigationLinks?”optional frontendNavigationLinks: { href: string; label: string;}[];
Navigation Links for use with the @studiocms/frontend
package to display links in the frontend
identifier
Section titled “identifier”identifier: string;
Identifier of the plugin from the package.json
name: string;
Label of the plugin to be displayed in the StudioCMS Dashboard
pageTypes?
Section titled “pageTypes?”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
settingsPage?
Section titled “settingsPage?”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
settingsPage.endpoint
Section titled “settingsPage.endpoint”endpoint: string;
The endpoint for the settings
Should export a APIRoute named onSave
that runs when the settings page is saved
settingsPage.fields
Section titled “settingsPage.fields”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
SafePluginListType
Section titled “SafePluginListType”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^
Type Declaration
Section titled “Type Declaration”frontendNavigationLinks?
Section titled “frontendNavigationLinks?”optional frontendNavigationLinks: { href: string; label: string;}[];
Navigation Links for use with the @studiocms/frontend
package to display links in the frontend
identifier
Section titled “identifier”identifier: string;
Identifier of the plugin from the package.json
name: string;
Label of the plugin to be displayed in the StudioCMS Dashboard
pageTypes?
Section titled “pageTypes?”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
settingsPage?
Section titled “settingsPage?”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
settingsPage.endpoint
Section titled “settingsPage.endpoint”endpoint: string;
The endpoint for the settings
Should export a APIRoute named onSave
that runs when the settings page is saved
settingsPage.fields
Section titled “settingsPage.fields”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
SCMSAuthServiceFnOpts
Section titled “SCMSAuthServiceFnOpts”type SCMSAuthServiceFnOpts = { oAuthProvider: { endpointPath: string; formattedName: string; name: string; requiredEnvVariables?: string[]; svg: string; };};
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:257^
Type Declaration
Section titled “Type Declaration”oAuthProvider
Section titled “oAuthProvider”oAuthProvider: { endpointPath: string; formattedName: string; name: string; requiredEnvVariables?: string[]; svg: string;};
oAuthProvider.endpointPath
Section titled “oAuthProvider.endpointPath”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.
Example
Section titled “Example”`/src/auth/providers/google.ts`
oAuthProvider.formattedName
Section titled “oAuthProvider.formattedName”formattedName: string;
The formatted name of the OAuth provider, e.g., ‘Google’, ‘GitHub’, etc.
oAuthProvider.name
Section titled “oAuthProvider.name”name: string;
The name of the OAuth provider, e.g., ‘google’, ‘github’, etc.
oAuthProvider.requiredEnvVariables?
Section titled “oAuthProvider.requiredEnvVariables?”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.
oAuthProvider.svg
Section titled “oAuthProvider.svg”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.
Example
Section titled “Example”`<svg width="24px" height="24px" viewBox="0 0 98 96" xmlns="http://www.w3.org/2000/svg" class="oauth-logo">...</svg>`,
SCMSDashboardFnOpts
Section titled “SCMSDashboardFnOpts”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^
Type Declaration
Section titled “Type Declaration”dashboardGridItems?
Section titled “dashboardGridItems?”optional dashboardGridItems: GridItemInput[];
Allows the plugin to add custom dashboard grid items
dashboardPages?
Section titled “dashboardPages?”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
dashboardPages.admin?
Section titled “dashboardPages.admin?”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
dashboardPages.user?
Section titled “dashboardPages.user?”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
settingsPage?
Section titled “settingsPage?”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
settingsPage.endpoint
Section titled “settingsPage.endpoint”endpoint: string;
The endpoint for the settings
Should export a APIRoute named onSave
that runs when the settings page is saved
settingsPage.fields
Section titled “settingsPage.fields”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
SCMSFrontendFnOpts
Section titled “SCMSFrontendFnOpts”type SCMSFrontendFnOpts = { frontendNavigationLinks?: { href: string; label: string; }[];};
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:254^
Type Declaration
Section titled “Type Declaration”frontendNavigationLinks?
Section titled “frontendNavigationLinks?”optional frontendNavigationLinks: { href: string; label: string;}[] = FrontendNavigationLinksSchema;
Navigation Links for use with the @studiocms/frontend
package to display links in the frontend
SCMSImageServiceFnOpts
Section titled “SCMSImageServiceFnOpts”type SCMSImageServiceFnOpts = { imageService?: { identifier: string; servicePath: string | URL; };};
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:256^
Type Declaration
Section titled “Type Declaration”imageService?
Section titled “imageService?”optional imageService: { identifier: string; servicePath: string | URL;};
imageService.identifier
Section titled “imageService.identifier”identifier: string;
Identifier used for the preferredImageService
setting on StudioCMS
imageService.servicePath
Section titled “imageService.servicePath”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.
SCMSRenderingFnOpts
Section titled “SCMSRenderingFnOpts”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^
Type Declaration
Section titled “Type Declaration”pageTypes?
Section titled “pageTypes?”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
SCMSSiteMapFnOpts
Section titled “SCMSSiteMapFnOpts”type SCMSSiteMapFnOpts = { sitemaps?: { pluginName: string; sitemapXMLEndpointPath: string | URL; }[]; triggerSitemap?: boolean;};
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:252^
Type Declaration
Section titled “Type Declaration”sitemaps?
Section titled “sitemaps?”optional sitemaps: { pluginName: string; sitemapXMLEndpointPath: string | URL;}[];
Allows the plugin to add sitemap endpoints
triggerSitemap?
Section titled “triggerSitemap?”optional triggerSitemap: boolean;
If this is true, the plugin will enable the Sitemap
StudioCMSImageService()
Section titled “StudioCMSImageService()”type StudioCMSImageService = (src: string, props: ImageServiceExtraProps) => string | Promise<string>;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:368^
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
| Promise
<string
>
Variables
Section titled “Variables”SafePluginListItemSchema
Section titled “SafePluginListItemSchema”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.
SafePluginListSchema
Section titled “SafePluginListSchema”const SafePluginListSchema: ZodArray<SafePluginListType>;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:93^
StudioCMSSanitizeOptionsSchema
Section titled “StudioCMSSanitizeOptionsSchema”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.
Remarks
Section titled “Remarks”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.
Functions
Section titled “Functions”definePlugin()
Section titled “definePlugin()”function definePlugin(options: StudioCMSPlugin): StudioCMSPlugin;
Defined in: studiocms/packages/studiocms/src/schemas/plugins/index.ts:358^
Defines a plugin for StudioCMS.
Parameters
Section titled “Parameters”options
Section titled “options”The configuration options for the plugin.
Returns
Section titled “Returns”The plugin configuration.
References
Section titled “References”AvailableDashboardPages
Section titled “AvailableDashboardPages”Re-exports AvailableDashboardPages
DashboardPage
Section titled “DashboardPage”Re-exports DashboardPage
FinalDashboardPage
Section titled “FinalDashboardPage”Re-exports FinalDashboardPage
SettingsField
Section titled “SettingsField”Re-exports SettingsField
StudioCMSColorway
Section titled “StudioCMSColorway”Re-exports StudioCMSColorway