Membrane SDK - v0.8.0
    Preparing search index...

    Class MembraneConfigLoader

    Loads and manages Membrane configuration from environment variables and config files. Environment variables take precedence over config file values.

    Supported environment variables:

    • MEMBRANE_WORKSPACE_KEY: workspace key
    • MEMBRANE_WORKSPACE_SECRET: workspace secret
    • MEMBRANE_API_URI: API URI (optional)
    • MEMBRANE_TEST_CUSTOMER_ID: test customer ID (optional)
    Index

    Constructors

    • Creates a new config loader instance

      Parameters

      • cwd: string = ...

        Working directory to search for config file (defaults to process.cwd())

      Returns MembraneConfigLoader

    Methods

    • Loads configuration with environment variables taking precedence over file values

      Parameters

      Returns PartialMembraneConfig

      The loaded configuration (always returns an object, even if empty)

      Error if validation is requested and fails

    • Checks if a valid configuration can be loaded

      Returns boolean

      True if a valid configuration exists

    • Checks if workspace credentials are available (from env or config file)

      Returns boolean

      True if workspace key and secret are available

    • Clears the cached configuration

      Returns void

    • Saves configuration to file (excludes env-provided values)

      Parameters

      Returns boolean

      True if saved successfully

    • Gets the current working directory

      Returns string

    • Sets a new working directory and clears cache

      Parameters

      • newCwd: string

      Returns void