Saltearse al contenido

Configuración del Panel de Control

La configuración del esquema de opciones de la integración de StudioCMS

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardEnabled?: boolean | undefined
dashboardEnabled
: true,
dashboardRouteOverride?: string | undefined
dashboardRouteOverride
: 'dashboard',
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined
developerConfig
: {},
faviconURL?: string | undefined
faviconURL
: '/favicon.svg',
inject404Route?: boolean | undefined
inject404Route
: true,
versionCheck?: boolean | undefined
versionCheck
: true,
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
AuthConfig
: {},
},
});

dashboardEnabled es un booleano que se utiliza para determinar si el panel de control está habilitado.

  • Tipo: boolean
  • Por defecto: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardEnabled?: boolean | undefined
dashboardEnabled
: true, // PREDETERMINADO - Esto habilita el panel de control.
}
})

DashboardRouteOverride es un string que se utiliza para determinar la ruta para el panel de control.

  • Tipo: string
  • Por defecto: 'dashboard'
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
dashboardRouteOverride?: string | undefined
dashboardRouteOverride
: 'dashboard', // PREDETERMINADO - Esto establece la ruta del panel de control en /dashboard.
}
})

developerConfig es un objeto que se utiliza para configurar la configuración del desarrollador para el dashboard.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined
developerConfig
: {
testingAndDemoMode?: boolean | undefined
testingAndDemoMode
: false, // PREDETERMINADO - Esto deshabilita el modo de prueba y demostración.
},
}
})

faviconURL es un string que se utiliza para determinar la ruta al favicon para el panel de control.

  • Tipo: string
  • Por defecto: '/favicon.svg'
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
faviconURL?: string | undefined
faviconURL
: '/favicon.svg', // Predeterminado - Esto establece el favicon para el panel de control.
}
})

inject404Route es un booleano que se utiliza para determinar si se debe inyectar la ruta 404.

  • Tipo: boolean
  • Por defecto: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
inject404Route?: boolean | undefined
inject404Route
: true, // PREDETERMINADO - Esto inyecta la ruta 404.
}
})

versionCheck es un booleano que se utiliza para determinar si se debe habilitar la comprobación de versiones.

  • Tipo: boolean
  • Por defecto: true
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
versionCheck?: boolean | undefined
versionCheck
: true, // PREDETERMINADO - Esto habilita la comprobación de versiones.
}
})

AuthConfig es un objeto que se utiliza para configurar la configuración de autenticación para el panel de control.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
AuthConfig
: {
enabled?: boolean | undefined
enabled
: true, // PREDETERMINADO - Esto habilita la autenticación.
},
}
})

providers es un objeto que se utiliza para configurar los proveedores de autenticación para el panel de control.

studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
AuthConfig
: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined
providers
: {
google?: boolean | undefined
google
: true,
github?: boolean | undefined
github
: true,
discord?: boolean | undefined
discord
: true,
auth0?: boolean | undefined
auth0
: true,
usernameAndPassword?: boolean | undefined
usernameAndPassword
: true,
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined
usernameAndPasswordConfig
: {},
},
},
},
})

usernameAndPasswordConfig es un objeto que se utiliza para configurar la configuración de nombre de usuario y contraseña para el panel de control.

  • Tipo: { allowUserRegistration?: boolean }
  • Por defecto: {}
studiocms.config.mjs
export default
function defineStudioCMSConfig(config: StudioCMSOptions): {
dbStartPage?: boolean | undefined;
rendererConfig?: {
studiocms?: false | {
callouts?: false | {
theme?: "github" | "obsidian" | "vitepress" | undefined;
} | undefined;
autoLinkHeadings?: boolean | undefined;
discordSubtext?: boolean | undefined;
sanitize?: {
allowElements?: string[] | undefined;
blockElements?: string[] | undefined;
dropElements?: string[] | undefined;
allowAttributes?: Record<string, string[]> | undefined;
dropAttributes?: Record<string, string[]> | undefined;
allowComponents?: boolean | undefined;
allowCustomElements?: boolean | undefined;
allowComments?: boolean | undefined;
} | undefined;
} | undefined;
renderer?: "studiocms" | CustomRenderer | "astro" | "markdoc" | "mdx" | undefined;
markdocConfig?: {
renderType?: "html" | MarkdocRenderer | "react-static" | undefined;
argParse?: {
file?: string | undefined;
slots?: boolean | undefined;
location?: boolean | undefined;
} | undefined;
transformConfig?: {
tags?: Record<string, {}> | undefined;
validation?: {
parents?: any[] | undefined;
validateFunctions?: boolean | undefined;
environment?: string | undefined;
} | undefined;
...

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
({
dashboardConfig?: {
dashboardEnabled?: boolean | undefined;
inject404Route?: boolean | undefined;
faviconURL?: string | undefined;
dashboardRouteOverride?: string | undefined;
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined;
developerConfig?: {
testingAndDemoMode?: boolean | undefined;
} | undefined;
versionCheck?: boolean | undefined;
} | undefined
dashboardConfig
: {
AuthConfig?: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined;
enabled?: boolean | undefined;
} | undefined
AuthConfig
: {
providers?: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
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, // PREDETERMINADO - Esto permite el registro de usuarios.
},
},
},
},
})
type AuthProviders: {
github?: boolean | undefined;
discord?: boolean | undefined;
google?: boolean | undefined;
auth0?: boolean | undefined;
usernameAndPassword?: boolean | undefined;
usernameAndPasswordConfig?: {
allowUserRegistration?: boolean | undefined;
} | undefined;
} | undefined