# projects / craft cms / env-beacon

Env Beacon

Craft CMS · v1.0.0 · View on GitHub →

Env Beacon is a lightweight Craft CMS plugin that displays a small environment badge in the control panel and, optionally, on the front-end site — so editors, admins, and developers can tell at a glance whether they’re looking at Local, Development, Staging, QA, or Production.

It’s intentionally simple: no database tables, no queues, no external services, and no JavaScript dependency.

Requirements

  • Craft CMS 4.x or 5.x
  • PHP 8.0.2 or later

Installation

Install from the Craft Plugin Store (search for Env Beacon), or via Composer:

cd /path/to/project
composer require jainilnagar/env-beacon && php craft plugin/install env-beacon

Features

  • Control panel badge for the current environment, with an optional front-end badge (fixed bottom-right).
  • Automatic label detection from common environment variables, plus custom variable and custom label modes.
  • Automatic colors — Production/Live → red, Staging/Test/QA → amber, Local/Dev → blue — or a custom hex color.
  • Optional status dot, hostname display, admin-only visibility, and login-screen visibility.

Configuration

Configure from Settings → Plugins → Env Beacon, or override per-environment in config/env-beacon.php:

<?php

return [
    '*' => [
        'source' => 'auto',
        'colorMode' => 'auto',
        'showOnFrontend' => true,
    ],
    'staging' => [
        'label' => 'Staging',
        'source' => 'custom',
        'colorMode' => 'custom',
        'customColor' => '#d97706',
    ],
    'production' => [
        'label' => 'Production',
        'source' => 'custom',
        'colorMode' => 'custom',
        'customColor' => '#dc2626',
        'adminsOnly' => true,
    ],
];

Environment detection

When the label source is auto, Env Beacon checks common variables in order — ENV_BEACON_LABEL, CRAFT_ENVIRONMENT, ENVIRONMENT, APP_ENV, YII_ENV — and falls back to Craft’s devMode. The simplest setup is to set CRAFT_ENVIRONMENT (e.g. dev, staging, production) in your .env.

License

MIT.

← all projects source on GitHub →