UNPKG

mpesajs

Version:

A Node.js SDK for seamless integration with M-Pesa payment gateway, providing easy-to-use methods for handling transactions, payments, and API interactions

28 lines (27 loc) 1.28 kB
/** * Loads environment variables from .env.mpesajs or falls back to .env * @returns The loaded environment variables */ export declare function loadEnvVariables(): NodeJS.ProcessEnv; /** * Gets an environment variable with a fallback value * Returns the raw string value, allowing the importing file to handle parsing * @param key The environment variable key * @param defaultValue The default value if the environment variable is not set * @returns The environment variable value as a string or the default value */ export declare function getEnvVar(key: string, defaultValue: string): string; /** * Gets a numeric environment variable with a fallback value * @param key The environment variable key * @param defaultValue The default value if the environment variable is not set * @returns The parsed numeric value or the default value */ export declare function getNumericEnvVar(key: string, defaultValue: number): number; /** * Gets a boolean environment variable with a fallback value * @param key The environment variable key * @param defaultValue The default value if the environment variable is not set * @returns The parsed boolean value or the default value */ export declare function getBooleanEnvVar(key: string, defaultValue: boolean): boolean;