# Function withTimeoutConfig

- withTimeoutConfig<T>(promise: Promise<T>, config: TimeoutConfig): Promise<T>

  Execute a promise with timeout settings from a TimeoutConfig.

  Convenience wrapper around withTimeout for callers that already hold a `TimeoutConfig` object (e.g., from environment config).

  #### Type Parameters

  - T

    Type of the promise result

  #### Parameters

  - promise: Promise<T>

    Promise to execute with timeout

  - config: TimeoutConfig

    Timeout configuration object

  #### Returns Promise<T>

  Promise resolving with the result or rejecting with TimeoutError

  #### Throws

  If the operation exceeds `config.timeoutMs`

  #### Throws

  If `config.timeoutMs` is not positive

  #### Example

      const config: TimeoutConfig = { timeoutMs: 5000, operationName: 'fetchMEPs' };
      const result = await withTimeoutConfig(fetchMEPs(), config);

  #### Since

  0.8.0

  - Defined in utils/timeout.ts:363