Skip to content

Function: normalizeBusSecret()

Makaio Framework


Makaio Framework / utils / normalizeBusSecret

normalizeBusSecret(raw): string | undefined

Defined in: ../../../packages/utils/src/normalize-bus-secret.ts:20

Normalize a raw MAKAIO_BUS_SECRET value.

  • undefined (variable unset) → returns undefined
  • Non-empty string after trimming → returns the trimmed value
  • Empty string or whitespace-only → throws, because a secret that collapses to the empty string is almost certainly a misconfiguration and must not silently fall back to unauthenticated mode.

string | undefined

The raw environment variable value, or undefined when unset.

string | undefined

The trimmed secret string, or undefined when the variable is unset.

When the variable is set but evaluates to an empty string after trimming.