Skip to main content
Barekey stores values as strings, then parses them according to each variable’s declared type. That matters because await barekey.get("KEY") returns the parsed value, not just the raw string.

Supported declared types

Creating typed variables

Examples:

Reading typed values with the SDK

Typical resolved value shapes:
  • MAX_CONNECTIONS -> 100n
  • FEATURE_ENABLED -> true
  • RELEASED_AT -> new Date(...)
  • FEATURE_FLAGS -> parsed JSON

Use inspect() for raw and parsed values together

Why declared types matter

Declared types make Barekey more useful because they:
  • produce better generated SDK types
  • reduce manual parsing in application code
  • make CLI and API metadata easier to understand
  • catch bad values earlier

Recommendation

Always set --type when creating variables unless you truly want an unstructured string value.