Skip to content

@studiocms/devapps

A Collection of useful tools available during dev mode in Astro.

  1. Install the package and add to your astro config using the following command:

    Terminal window
    npx astro add @studiocms/devapps
  2. Update your config file as shown under Example Config below.

All tools will only be available during astro dev and will not be available during production deployments!

astro.config.mjs
import {
function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never>(config: AstroUserConfig<TLocales, TDriver>): AstroUserConfig<TLocales, TDriver>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
} from 'astro/config';
import
function db(): AstroIntegration[]
db
from '@astrojs/db';
import
function devApps(opts?: StudioCMSDevAppsOptions): AstroIntegration

Integrates StudioCMS development applications with Astro.

@paramopts - Optional configuration options for StudioCMS DevApps.

@returnsThe Astro integration object for StudioCMS DevApps.

@example

import { studioCMSDevApps } from '@studiocms/devapps';
export default {
integrations: [
studioCMSDevApps({
endpoint: '/api',
appsConfig: {
wpImporter: {
enabled: true,
endpoint: '/wp-import',
},
libSQLViewer: {
enabled: true,
},
},
verbose: true,
}),
],
};

devApps
from '@studiocms/devapps';
export default
defineConfig<never, never>(config: AstroUserConfig<never, never>): AstroUserConfig<never, never>

See the full Astro Configuration API Documentation https://astro.build/config

defineConfig
({
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.site?: string

@namesite

@type{string}

@description

Your final, deployed URL. Astro uses this full URL to generate your sitemap and canonical URLs in your final build. It is strongly recommended that you set this configuration to get the most out of Astro.

{
site: 'https://www.my-site.dev'
}

site
: "https://example.com",
AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[]

@nameintegrations

@description

Extend Astro with custom integrations. Integrations are your one-stop-shop for adding framework support (like Solid.js), new features (like sitemaps), and new libraries (like Partytown).

Read our Integrations Guide for help getting started with Astro Integrations.

import react from '@astrojs/react';
import mdx from '@astrojs/mdx';
{
// Example: Add React + MDX support to Astro
integrations: [react(), mdx()]
}

integrations
: [
function db(): AstroIntegration[]
db
(), // REQUIRED
function devApps(opts?: StudioCMSDevAppsOptions): AstroIntegration

Integrates StudioCMS development applications with Astro.

@paramopts - Optional configuration options for StudioCMS DevApps.

@returnsThe Astro integration object for StudioCMS DevApps.

@example

import { studioCMSDevApps } from '@studiocms/devapps';
export default {
integrations: [
studioCMSDevApps({
endpoint: '/api',
appsConfig: {
wpImporter: {
enabled: true,
endpoint: '/wp-import',
},
libSQLViewer: {
enabled: true,
},
},
verbose: true,
}),
],
};

devApps
(/* See Config Options Below */),
],
});

Full list of options available for the devApps integration, with default values shown. All options are optional.

endpoint?: string | undefined
endpoint
: '_studiocms-devapps',
verbose?: boolean | undefined
verbose
: false,
appsConfig?: {
wpImporter: boolean | {
endpoint?: string | undefined;
};
libSQLViewer?: boolean | undefined;
} | undefined
appsConfig
: {
libSQLViewer?: boolean | undefined
libSQLViewer
: true,
wpImporter: boolean | {
endpoint?: string | undefined;
}
wpImporter
: true,
},

Development tool to view the SQL tables in the libSQL database in the browser. The tool rely’s on the @astrojs/db libSQL remote database connection credentials.

The following env variables set (Also used for @astrojs/db):

  • ASTRO_DB_REMOTE_URL
  • ASTRO_DB_APP_TOKEN
  • Toolbar app (Closed)

Astro DevToolbarApp

  • Toolbar app (Expanded)

Astro DevToolbarApp (Expanded)

Development tool to import WordPress posts and pages into the StudioCMS database.

  • StudioCMS Integration
  • WordPress Install
  • @studiocms/blog (Optional: for importing Posts under a blog)
  • Toolbar app

Astro DevToolbarApp