@sensimods/utility-lab
    Preparing search index...

    Function getEnv

    • Safely retrieves an environment variable.

      Parameters

      • key: string

        The name of the environment variable to retrieve.

      • fallback: string = ""

        The value to return if the environment variable is not set (default is an empty string).

      Returns string

      The value of the environment variable or the fallback.

      const apiUrl = getEnv("API_URL", "https://default.api.com");
      console.log(apiUrl); // Will log the value of API_URL or "https://default.api.com" if not set