Env Vars

Environment variables with secrets masked until asked for. Reveal is per-row and never sticky — nothing survives a remount, so a shared screen cannot leak what someone expanded an hour ago.

src/components/ui/env-vars.tsx

About

From the component's own source, where it was written.

Environment variables, with secrets masked until asked for.

Reveal is per-row and never sticky — there is no "show all", and nothing is remembered across a remount. Someone screen-sharing a deploy dashboard should not have every production secret on screen because they expanded one an hour ago.

The mask is a fixed width rather than the value's real length, since the length of a secret is itself a hint about what it is.

Install

npx astralyx-ui add env-vars

Usage

import { EnvVars } from '@/components/ui/env-vars'

<EnvVars vars={vars} />

Composer

Change the props and the source below follows.

  • NODE_ENV
    production
    prod
  • DATABASE_URL
    ••••••••••••
    prodpreview
  • STRIPE_SECRET_KEY
    ••••••••••••
    prod
  • NEXT_PUBLIC_API_URL
    https://api.astralyx.dev
    prodpreviewdev
Props
tsx
<EnvVars vars={vars} />

Examples

Variables

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

EnvVars

Extends ComponentProps<'div'>.

PropTypeDefaultDescription
varsEnvVar[]required{ key, value, secret?, scopes?, updated? }.

Types

EnvVar

Environment variables, with secrets masked until asked for.

FieldTypeDescription
keystring—
valuestring—
secret?booleanMasks the value and adds a reveal toggle. The mask is a fixed width, since the length of a secret is itself a hint about what it is.
scopes?string[]Environments the variable applies to, shown as badges.
updated?string—

Behaviour

TopicDetailDescription
copyalways availableCopies the real value even while masked — the common reason to open one of these is to paste it somewhere.