@shiftescape/astro-env-inspector

Your env vars, always in reach.

Dev toolbar panel that shows all your environment variables — grouped, masked, and searchable — directly inside astro dev. Active only in development, zero production footprint.

Env Inspector — dev toolbar
🌐 PUBLIC (PUBLIC_*)
PUBLIC_SITE_NAME My Astro Site
PUBLIC_API_URL https://api.example.com
PUBLIC_API_KEY •••••••• ⚠ leaking secret

🔒 PRIVATE / SERVER-ONLY
DATABASE_URL postgres://localhost/db
STRIPE_SECRET_KEY •••••••• 👁
SENDGRID_API_KEY not set

🚀 ASTRO BUILT-INS
MODE development
DEV true
BASE_URL /

PUBLIC: 3 PRIVATE: 8 ASTRO: 4

features

Everything about your env, at a glance.

No more grepping `.env` files or digging through terminal output.

01
Grouped

Public, private, and Astro built-ins in separate sections for fast scanning.

02
Masked by default

Sensitive values hidden. Per-variable reveal toggle for safe screen sharing.

03
Leak detection

Warns when a PUBLIC_* var looks like it contains a secret key or token.

04
Set vs missing

Instantly spot variables your app expects but haven't been defined yet.

05
Searchable

Filter by key or value in real time across all variable groups.

06
Dev-only

Completely stripped in astro build. Zero production footprint, guaranteed.

configuration

Works out of the box.

Add it with no options — everything is detected automatically. Customise when you need to.

astro.config.mjs
import { defineConfig } from 'astro/config'
import envInspector from '@shiftescape/astro-env-inspector'

export default defineConfig({
  integrations: [
    envInspector({
      // extra patterns to always mask
      sensitivePatterns: ['MY_APP_SECRET', 'INTERNAL_*'],
      // hide Astro built-ins (MODE, DEV, PROD…)
      showAstroBuiltins: false,
      // start values revealed (not for shared screens)
      revealByDefault: false,
    }),
  ],
})
Option Type Default Description
sensitivePatterns string[] [] Extra key patterns to mask. Supports * suffix wildcard.
showAstroBuiltins boolean true Show MODE, DEV, PROD, SITE, BASE_URL etc.
revealByDefault boolean false Start with all sensitive values unmasked. Not recommended for shared screens.

install

One line and you're done.

Works with Astro 4, 5, and 6. No other dependencies required.

npmnpm install -D @shiftescape/astro-env-inspector
pnpmpnpm add -D @shiftescape/astro-env-inspector
yarnyarn add -D @shiftescape/astro-env-inspector
zero-config usage
import envInspector from '@shiftescape/astro-env-inspector'

export default defineConfig({
  integrations: [envInspector()]  // click 🔍 in the dev toolbar
})