setting and getting variables in settings.php

Submitted bybarnettech onFri, 10/15/2021 - 11:48
  use Drupal\Core\Site\Settings;
    $api_key = Settings::get('ipc_merge');
    $key = \Drupal::request()->server->get('HTTP_X_API_KEY');

then in settings.local.php or settings.php you would put

  $settings['ipc_merge'] = 'XXXXXXXXXXXXXXXXXXXXXXXX';