Skip to content

StudioCMSOptions

StudioCMS Integration config options schema reference

studiocms.config.mjs
// Default Values shown
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
dbStartPage?: boolean | undefined
dbStartPage
: true,
db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined
db
: {},
verbose?: boolean | undefined
verbose
: false,
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined
logLevel
: 'Info',
plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" | "heroicons:arrow-left" | "heroicons:arrow-left-16-solid" | "heroicons:arrow-left-20-solid" | "heroicons:arrow-left-circle" | "heroicons:arrow-left-circle-16-solid" | "heroicons:arrow-left-circle-20-solid" | "heroicons:arrow-left-circle-solid" | "heroicons:arrow-left-end-on-rectangle" | "heroicons:arrow-left-end-on-rectangle-16-solid" | "heroicons:arrow-left-end-on-rectangle-20-solid" | "heroicons:arrow-left-end-on-rectangle-solid" | "heroicons:arrow-left-on-rectangle" | "heroicons:arrow-left-on-rectangle-20-solid" | "heroicons:arrow-left-on-rectangle-solid" ...
plugins
: [],
componentRegistry?: {
readonly [x: string]: string;
} | undefined
componentRegistry
: {},
locale?: {
readonly dateLocale?: string | undefined;
readonly dateTimeFormat?: {
readonly localeMatcher?: "best fit" | "lookup" | undefined;
readonly weekday?: "long" | "short" | "narrow" | undefined;
readonly era?: "long" | "short" | "narrow" | undefined;
readonly year?: "numeric" | "2-digit" | undefined;
readonly month?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined;
readonly day?: "numeric" | "2-digit" | undefined;
readonly hour?: "numeric" | "2-digit" | undefined;
readonly minute?: "numeric" | "2-digit" | undefined;
readonly second?: "numeric" | "2-digit" | undefined;
readonly timeZoneName?: "long" | "short" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined;
readonly formatMatcher?: "basic" | "best fit" | undefined;
readonly hour12?: boolean | undefined;
readonly timeZone?: string | undefined;
} | undefined;
readonly i18n?: {
readonly defaultLocale?: string | undefined;
} | undefined;
} | undefined
locale
: {},
features?: {
readonly robotsTXT?: boolean | {
readonly host?: string | boolean | undefined;
readonly sitemap?: string | boolean | readonly string[] | undefined;
readonly policy?: readonly {
readonly userAgent?: "360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" | "Yandex" | "YandexMobileBot" | "Algolia Crawler" | "BublupBot" | "CCBot" | "Cliqzbot" | "Daumoa" | "DeuSu" | "EuripBot" | "Exploratodo" | "Feedly" | "Findxbot" | "istellabot" | "JikeSpider" | "Lycos" | "Mail.Ru" | "MojeekBot" | "OrangeBot" | "Pinterest" | "Plukkie" | "Qwantify" | "Rambler" | "SemanticScholarBot" | "SeSchemanamBot" | "Sosospider" | "Slurp" | "Twitterbot" | "WhatsApp" | "yacybot" | "YepBot" | "Yeti" | "YioopBot" | "yooSchemaBot" | "YoudaoBot" | "*" | readonly ("360Spider" | "360Spider-Image" | "360Spider-Video" | "HaoSouSpider" | "AdsBot-Google" | "AdsBot-Google-Mobile" | "AdsBot-Google-Mobile-Apps" | "Googlebot" | "Googlebot-Image" | "Googlebot-Mobile" | "Googlebot-News" | "Googlebot-Video" | "Mediapartners-Google" | "adidxbot" | "bingbot" | "BingPreview" | "MicrosoftPreview" | "msnbot" | "msnbot-media" | "Applebot" | "AppleNewsBot" | "Baiduspider" | "Baiduspider-image" | "Baiduspider-mobile" | "Baiduspider-news" | "Baiduspider-video" | "coccoc" | "coccocbot-image" | "coccocbot-web" | "DuckDuckBot" | "DuckDuckGo-Favicons-Bot" | "facebookcatalog" | "facebookexternalhit" | "Facebot" | "gooblog" | "ichiro" | "Sogou blog" | "Sogou inst spider" | "Sogou News Spider" | "Sogou Orion spider" | "Sogou spider2" | "Sogou web spider" | "Yandex" | "YandexMobileBot" | "Algolia Crawler" | "BublupBot" | "CCBot" | "Cliqzbot" | "Daumoa" | "DeuSu" | "EuripBot" | "Exploratodo" | "Feedly" | "Findxbot" | "istellabot" | "JikeSpider" | "Lycos" | "Mail.Ru" | "MojeekBot" | "OrangeBot" | "Pinterest" | "Plukkie" | "Qwantify" | "Rambler" | "SemanticScholarBot" | "SeSchemanamBot" | "Sosospider" | "Slurp" | "Twitterbot" | "WhatsApp" | "yacybot" | "YepBot" | "Yeti" | "YioopBot" | "yooSchemaBot" | "YoudaoBot" | "*")[] | undefined;
readonly allow?: string | readonly string[] | undefined;
readonly disallow?: string | readonly string[] | undefined;
readonly crawlDelay?: number | undefined;
readonly cleanParam?: string | readonly string[] | undefined;
}[] | undefined;
} | undefined;
... 7 more ...;
readonly api?: {
readonly apiDocs?: boolean | undefined;
} | undefined;
} | undefined
features
: {}
});

Project initialization page - Used during first time setup to create your database configuration.

  • Type: boolean
  • Default: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
dbStartPage?: boolean | undefined
dbStartPage
: true, // DEFAULT - This injects a start page to setup your DB data.
})

db is an object that is used to configure the database dialect.

  • Type: DBConfigSchema
  • Default: {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined
db
: {
dialect?: "libsql" | "postgres" | "mysql" | undefined
dialect
: 'libsql', // 'libsql' | 'postgresql' | 'mysql'
},
})

storageManager is used to configure the storage manager plugin for StudioCMS.

  • Type: StudioCMSStorageManager
  • Default: undefined
studiocms.config.mjs
import
function s3Storage(): StudioCMSStorageManagerDef

Creates and configures a StudioCMS S3 Storage Manager plugin.

This function initializes the S3 storage integration for StudioCMS by defining a storage manager plugin with the necessary configuration and hooks.

@returnsA configured storage manager instance that integrates S3 storage capabilities with StudioCMS.

@example

import { studiocmsS3Storage } from '@studiocms/s3-storage';
const s3Storage = studiocmsS3Storage();

s3Storage
from '@studiocms/s3-storage';
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
storageManager?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" | "heroicons:arrow-left" | "heroicons:arrow-left-16-solid" | "heroicons:arrow-left-20-solid" | "heroicons:arrow-left-circle" | "heroicons:arrow-left-circle-16-solid" | "heroicons:arrow-left-circle-20-solid" | "heroicons:arrow-left-circle-solid" | "heroicons:arrow-left-end-on-rectangle" | "heroicons:arrow-left-end-on-rectangle-16-solid" | "heroicons:arrow-left-end-on-rectangle-20-solid" | "heroicons:arrow-left-end-on-rectangle-solid" | "heroicons:arrow-left-on-rectangle" | "heroicons:arrow-left-on-rectangle-20-solid" | "heroicons:arrow-left-on-rectangle-solid" ...
storageManager
:
function s3Storage(): StudioCMSStorageManagerDef

Creates and configures a StudioCMS S3 Storage Manager plugin.

This function initializes the S3 storage integration for StudioCMS by defining a storage manager plugin with the necessary configuration and hooks.

@returnsA configured storage manager instance that integrates S3 storage capabilities with StudioCMS.

@example

import { studiocmsS3Storage } from '@studiocms/s3-storage';
const s3Storage = studiocmsS3Storage();

s3Storage
(),
})

verbose is a boolean that is used to enable or disable verbose logging.

  • Type: boolean
  • Default: false
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
verbose?: boolean | undefined
verbose
: false, // DEFAULT - This sets the verbose logging to false.
})

logLevel is a union for setting the LogLevel for Effect based code.

  • Type: All | Fatal | Error | Warning | Info | Debug | Trace | None
  • Default: Info
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined
logLevel
: 'Info', // DEFAULT
})

plugins is an array that is used to determine which plugins should be loaded.

  • Type: StudioCMSPlugin[]
  • Default: []
studiocms.config.mjs
import
function blog(options?: StudioCMSBlogOptions): StudioCMSPluginDef

Creates and configures the StudioCMS Blog plugin.

@paramoptions - Optional configuration options for the blog plugin.

@returnsThe configured StudioCMS plugin.

@example

const blogPlugin = studioCMSBlogPlugin({
blog: {
title: 'My Blog',
enableRSS: true,
route: '/my-blog'
},
sitemap: true,
injectRoutes: true
});

@paramoptions.blog - Blog-specific options.

@paramoptions.blog.title - The title of the blog. Defaults to 'Blog'.

@paramoptions.blog.enableRSS - Whether to enable RSS feed. Defaults to true.

@paramoptions.blog.route - The route for the blog. Defaults to '/blog'.

@paramoptions.sitemap - Whether to trigger sitemap generation. Defaults to true.

@paramoptions.injectRoutes - Whether to inject routes for the blog. Defaults to true.

blog
from '@studiocms/blog';
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" | "heroicons:arrow-left" | "heroicons:arrow-left-16-solid" | "heroicons:arrow-left-20-solid" | "heroicons:arrow-left-circle" | "heroicons:arrow-left-circle-16-solid" | "heroicons:arrow-left-circle-20-solid" | "heroicons:arrow-left-circle-solid" | "heroicons:arrow-left-end-on-rectangle" | "heroicons:arrow-left-end-on-rectangle-16-solid" | "heroicons:arrow-left-end-on-rectangle-20-solid" | "heroicons:arrow-left-end-on-rectangle-solid" | "heroicons:arrow-left-on-rectangle" | "heroicons:arrow-left-on-rectangle-20-solid" | "heroicons:arrow-left-on-rectangle-solid" ...
plugins
: [
function blog(options?: StudioCMSBlogOptions): StudioCMSPluginDef

Creates and configures the StudioCMS Blog plugin.

@paramoptions - Optional configuration options for the blog plugin.

@returnsThe configured StudioCMS plugin.

@example

const blogPlugin = studioCMSBlogPlugin({
blog: {
title: 'My Blog',
enableRSS: true,
route: '/my-blog'
},
sitemap: true,
injectRoutes: true
});

@paramoptions.blog - Blog-specific options.

@paramoptions.blog.title - The title of the blog. Defaults to 'Blog'.

@paramoptions.blog.enableRSS - Whether to enable RSS feed. Defaults to true.

@paramoptions.blog.route - The route for the blog. Defaults to '/blog'.

@paramoptions.sitemap - Whether to trigger sitemap generation. Defaults to true.

@paramoptions.injectRoutes - Whether to inject routes for the blog. Defaults to true.

blog
(),
],
})

componentRegistry is an object that is used to register components.

  • Type: Record<string, string>
  • Default: {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
readonly dbStartPage?: boolean | undefined;
readonly verbose?: boolean | undefined;
readonly logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
readonly db?: {
readonly dialect?: "libsql" | "postgres" | "mysql" | undefined;
} | undefined;
readonly plugins?: {
readonly identifier: string;
readonly name: string;
readonly studiocmsMinimumVersion?: string | undefined;
readonly requires?: readonly string[] | undefined;
readonly hooks: {
"studiocms:astro-config"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly addIntegrations: (args: AstroIntegration | AstroIntegration[]) => Promise<void>;
}) => void) | undefined;
"studiocms:auth"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => Promise<void>) | ((args: {
readonly logger: AstroIntegrationLogger;
readonly setAuthService: (args: {
oAuthProvider: {
readonly name: string;
readonly formattedName: string;
readonly svg: string;
readonly endpointPath: string;
readonly requiredEnvVariables?: readonly string[] | undefined;
};
}) => Promise<void>;
}) => void) | undefined;
"studiocms:dashboard"?: ((args: {
readonly logger: AstroIntegrationLogger;
readonly setDashboard: (args: {
translations: {
[x: string]: {
[x: string]: {
[x: string]: string;
};
};
};
dashboardGridItems?: readonly {
readonly name: string;
readonly span: 1 | 2 | 3;
readonly variant: "default" | "filled";
readonly requiresPermission?: "owner" | "admin" | "editor" | "visitor" | undefined;
readonly header?: {
readonly title: string;
readonly icon?: "heroicons:academic-cap" | "heroicons:academic-cap-16-solid" | "heroicons:academic-cap-20-solid" | "heroicons:academic-cap-solid" | "heroicons:adjustments-horizontal" | "heroicons:adjustments-horizontal-16-solid" | "heroicons:adjustments-horizontal-20-solid" | "heroicons:adjustments-horizontal-solid" | "heroicons:adjustments-vertical" | "heroicons:adjustments-vertical-16-solid" | "heroicons:adjustments-vertical-20-solid" | "heroicons:adjustments-vertical-solid" | "heroicons:archive-box" | "heroicons:archive-box-16-solid" | "heroicons:archive-box-20-solid" | "heroicons:archive-box-arrow-down" | "heroicons:archive-box-arrow-down-16-solid" | "heroicons:archive-box-arrow-down-20-solid" | "heroicons:archive-box-arrow-down-solid" | "heroicons:archive-box-solid" | "heroicons:archive-box-x-mark" | "heroicons:archive-box-x-mark-16-solid" | "heroicons:archive-box-x-mark-20-solid" | "heroicons:archive-box-x-mark-solid" | "heroicons:arrow-down" | "heroicons:arrow-down-16-solid" | "heroicons:arrow-down-20-solid" | "heroicons:arrow-down-circle" | "heroicons:arrow-down-circle-16-solid" | "heroicons:arrow-down-circle-20-solid" | "heroicons:arrow-down-circle-solid" | "heroicons:arrow-down-left" | "heroicons:arrow-down-left-16-solid" | "heroicons:arrow-down-left-20-solid" | "heroicons:arrow-down-left-solid" | "heroicons:arrow-down-on-square" | "heroicons:arrow-down-on-square-16-solid" | "heroicons:arrow-down-on-square-20-solid" | "heroicons:arrow-down-on-square-solid" | "heroicons:arrow-down-on-square-stack" | "heroicons:arrow-down-on-square-stack-16-solid" | "heroicons:arrow-down-on-square-stack-20-solid" | "heroicons:arrow-down-on-square-stack-solid" | "heroicons:arrow-down-right" | "heroicons:arrow-down-right-16-solid" | "heroicons:arrow-down-right-20-solid" | "heroicons:arrow-down-right-solid" | "heroicons:arrow-down-solid" | "heroicons:arrow-down-tray" | "heroicons:arrow-down-tray-16-solid" | "heroicons:arrow-down-tray-20-solid" | "heroicons:arrow-down-tray-solid" ...

A utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is studiocms.config.mjs. And it should be adjacent to the Astro project's astro.config.mjs file.

StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.

Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.

@example

// studiocms.config.mjs
import { defineStudioCMSConfig } from 'studiocms/config';
export default defineStudioCMSConfig({
dbStartPage: true,
// ...Other Options
})

defineStudioCMSConfig
({
componentRegistry?: {
readonly [x: string]: string;
} | undefined
componentRegistry
: {
'my-component': './src/components/MyComponent.astro',
},
})

locale allows setting Locale specific settings

features is an object that allows adjusting the StudioCMS Dashboard features