Skip to content

Latest commit

 

History

History
444 lines (345 loc) · 9.33 KB

File metadata and controls

444 lines (345 loc) · 9.33 KB
i18nReady true
title Features
description Reference page for StudioCMSOptions features
sidebar
order
3
tableOfContents
minHeadingLevel maxHeadingLevel
2
5

StudioCMS Integration config options schema reference

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {},
});

robotsTXT

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/'] } ] }

Usage

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

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    robotsTXT: {
      policy: [ 
        { 
          userAgent: ['*'], 
          allow: ['/'], 
          disallow: ['/dashboard/'],
        } 
      ] 
    }
  }
})

injectQuickActionsMenu

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    injectQuickActionsMenu: true
  }
})

sdk

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.

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
import { Duration } from 'effect';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    sdk: {
      cacheConfig: {
          lifetime: Duration.minutes(5),
      },
    }
  }
})

cacheConfig

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

  • Type: boolean | { lifetime?: Duration | undefined; } | undefined
  • Default: { lifetime: Duration.minutes(5) }

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
import { Duration } from 'effect';
export default defineStudioCMSConfig({
  features: {
    sdk: {
      // DEFAULT - This uses the default cache configuration.
      cacheConfig: {
          lifetime: Duration.minutes(5),
      }, 
    }
  }
})

dashboardConfig

dashboardConfig allows customization of the Dashboard Configuration

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {}
  }
})

dashboardEnabled

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      dashboardEnabled: true,
    }
  }
})

inject404Route

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      inject404Route: true,
    }
  }
})

faviconURL

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      faviconURL: '/favicon.svg',
    }
  }
})

dashboardRouteOverride

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      dashboardRouteOverride: 'dashboard',
    }
  }
})

versionCheck

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.

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      versionCheck: true,
    }
  }
})

security

security Allows customization of the Security Configuration

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      security: {}
    }
  }
})

hideGeneratorTags

hideGeneratorTags Allows enabling or disabling of the Generator Meta Tags in the Dashboard HTML

  • Type: boolean
  • Default: false
Usage
import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    dashboardConfig: {
      security: {
        hideGeneratorTags: false
      }
    }
  }
})

authConfig

authConfig Allows customization of the Authentication Configuration

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    authConfig: {}
  }
})

enabled

Allows enabling or disabling of the Authentication Configuration

  • Type: boolean
  • Default: true

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    authConfig: {
      enabled: true
    }
  }
})

providers

Allows enabling or disabling of the Authentication Providers

The following provider can be configured from here: usernameAndPassword.

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    authConfig: {
      providers: {
        usernameAndPassword: true,
        usernameAndPasswordConfig: {
          allowUserRegistration: true
        }
      }
    }
  }
})

developerConfig

developerConfig Allows customization of the Developer Options

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    developerConfig: {}
  }
})

demoMode

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.

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    developerConfig: {
      demoMode: {
        username: 'foo',
        password: 'bar'
      }
    }
  }
})

preferredImageService

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

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    preferredImageService: 'cloudinary-js'
  }
})

webVitals

webVitals Allows enabling or disabling of Web Vitals tracking

  • Type: boolean
  • Default: false

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    webVitals: true
  }
})

api

api allows configuring API specific features

  • Type: ApiConfig | undefined
  • Default: undefined

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    api: {
      // api specific features here
    }
  }
})

api.apiDocs

apiDocs allows enabling or disabling of the API Docs route which provides an OpenAPI Spec for the StudioCMS API

  • Type: boolean
  • Default: true

Usage

import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
  features: {
    api: {
      apiDocs: true
    }
  }
})