Saltearse al contenido

Features

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

StudioCMS Integration config options schema reference

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {},
});

robotsTXT Allows the user to enable/disable and configure the use of the StudioCMS Custom astro-robots-txt Integration

  • Type: RobotsConfig | boolean
  • Default: { policy: [ { userAgent: ['*'], allow: ['/'], disallow: ['/dashboard/'] } ] }

Note: robotsTXT can also be set to false to disable it.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
robotsTXT?: boolean | RobotsConfig | undefined
robotsTXT
: {
RobotsConfig.policy?: PolicyOptions[] | undefined

@description [ Optional ] List of policy rules.

@default

policy:[
{
userAgent: "*",
allow: "/"
}
]

For more help, refer to SYNTAX by Yandex.

policy
: [
{
PolicyOptions.userAgent?: UserAgentType | UserAgentType[]

@description [ Required ] Indicates the robot to which the rules listed in robots.txt apply.

@example

policy:[
{
userAgent: [
'Googlebot',
'Applebot',
'Baiduspider',
'bingbot'
],
// crawling rule(s) for above bots
}
]

Verified bots, refer to DITIG or Cloudflare Radar.

userAgent
: ['*'],
PolicyOptions.allow?: string | string[]

@description [ At least one or more allow or disallow entries per rule ] Allows indexing site sections or individual pages.

@example

policy:[{allow:["/"]}]

Path-based URL matching, refer to SYNTAX via Google.

allow
: ['/'],
PolicyOptions.disallow?: string | string[]

@description [ At least one or more disallow or allow entries per rule ] Prohibits indexing site sections or individual pages.

@example

policy:[
{
disallow:[
"/admin",
"/uploads/1989-08-21/*.jpg$"
]
}
]

Path-based URL matching, refer to SYNTAX via Google.

disallow
: ['/dashboard/'],
}
]
}
}
})

injectQuickActionsMenu allows enabling and disabling the quick actions menu which allows easy access to your dashboard while logged in on non-dashboard pages.

  • Type: boolean
  • Default: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
injectQuickActionsMenu?: boolean | undefined
injectQuickActionsMenu
: true
}
})

sdk can either be a boolean or an object containing cache configuration. If it is a boolean, it defaults to true and transforms into an object with default cache configuration.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined
sdk
: {}
}
})

cacheConfig is an object that is used to configure the cache for the SDK.

  • Type: boolean | { lifetime?: string | undefined; } | undefined
  • Default: { lifetime: '5m' }
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined
sdk
: {
// DEFAULT - This uses the default cache configuration.
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined
cacheConfig
: {
lifetime?: string | undefined
lifetime
: '5m',
},
}
}
})

dashboardConfig allows customization of the Dashboard Configuration

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {}
}
})

dashboardEnabled allows the user to enable or disable the StudioCMS dashboard but still provide all the helper’s and utilities to those who are customizing their setup, doing so will disable the dashboard and you will need to manage your content via your database

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardEnabled?: boolean | undefined
dashboardEnabled
: true,
}
}
})

inject404Route allows the user to enable or disable the default 404 route for the dashboard

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
inject404Route?: boolean | undefined
inject404Route
: true,
}
}
})

faviconURL allows the user to override the default Favicon URL to a custom URL

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
faviconURL?: string | undefined
faviconURL
: '/favicon.svg',
}
}
})

dashboardRouteOverride allows the user to change the base route at which the dashboard is served (e.g., /admin instead of /dashboard)

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardRouteOverride?: string | undefined
dashboardRouteOverride
: 'dashboard',
}
}
})

versionCheck allows the user to enable or disable the version check for the dashboard.

This will check for the latest version of StudioCMS and notify the user if there is a new version available.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
versionCheck?: boolean | undefined
versionCheck
: true,
}
}
})

authConfig Allows customization of the Authentication Configuration

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {}
}
})

Allows enabling or disabling of the Authentication Configuration

  • Type: boolean
  • Default: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {
enabled?: boolean | undefined
enabled
: true
}
}
})

Allows enabling or disabling of the Authentication Providers

The following provider can be configured from here: usernameAndPassword.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
authConfig
: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined
providers
: {
usernameAndPassword?: boolean | undefined
usernameAndPassword
: true,
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined
usernameAndPasswordConfig
: {
allowUserRegistration?: boolean | undefined
allowUserRegistration
: true
}
}
}
}
})

developerConfig Allows customization of the Developer Options

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined
developerConfig
: {}
}
})

Enable demo mode for the site. If set to an object, the site will be in demo mode, and the user will be able to login with the provided username and password.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined
developerConfig
: {
demoMode?: false | {
password: string;
username: string;
} | undefined
demoMode
: {
username: string
username
: 'foo',
password: string
password
: 'bar'
}
}
}
})

preferredImageService Allows setting the identifier of the Preferred Image Service

Requires an Image Service to be installed such as 'cloudinary-js'

  • Type: string | undefined
  • Default: undefined
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
plugins?: StudioCMSPlugin[] | undefined;
logLevel?: "All" | "Fatal" | "Error" | "Warning" | "Info" | "Debug" | "Trace" | "None" | undefined;
dbStartPage?: boolean | undefined;
verbose?: boolean | undefined;
componentRegistry?: Record<string, string> | undefined;
locale?: {
dateLocale?: string | undefined;
dateTimeFormat?: Intl.DateTimeFormatOptions | undefined;
} | undefined;
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
injectQuickActionsMenu?: boolean | undefined;
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
versionCheck?: boolean | undefined;
} | undefined;
authConfig?: {
providers?: {
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
demoMode?: false | {
password: string;
username: string;
} | undefined;
} | undefined;
preferredImageService?: string ...

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';
export default defineStudioCMSConfig({
dbStartPage: true,
contentRenderer: 'marked',
verbose: true,
dateLocale: 'en-us',
// ...Other Options
})

defineStudioCMSConfig
({
features?: {
sdk?: boolean | {
cacheConfig?: boolean | {
lifetime?: string | undefined;
} | undefined;
} | undefined;
robotsTXT?: boolean | RobotsConfig | undefined;
... 4 more ...;
preferredImageService?: string | undefined;
} | undefined
features
: {
preferredImageService?: string | undefined
preferredImageService
:
var undefined
undefined
}
})