Webform POST handler, add API/header creds? Using the Remote POST handler in Webform 5, is there a way to add basic auth / API key to the request leveraging tokens or referencing a const? I'd like to find a way not to hardcode actual values.
Just adding an answer in addition to @Ryan Hartman's comment. Extend the RemotePostWebformHandler class and its ::buildConfigurationForm() method:
/**
 * Custom Webform submission remote post handler.
 *
 * @WebformHandler(
 *   id = &quot;custom_remote_post&quot;,
 *   ...
 * )  
 */
class CustomRemotePostWebformHandler extends RemotePostWebformHandler {

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);

    $form['api_key'] = [
      '#type' =&gt; 'textfield',
      '#title' =&gt; $this-&gt;t('API Key'),
      '#description' =&gt; $this-&gt;t('The API key for basic auth.'),
      '#default_value' =&gt; $this-&gt;configuration['api_key'] ?? NULL,
    ];

    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &amp;$form, FormStateInterface $form_state) {
    parent::submitConfigurationForm($form, $form_state);

    $this-&gt;configuration['api_key'] = $form_state-&gt;getValue('api_key') ?: NULL;
  }

  ...

Alternatively implement the form element provided by the Key module so you can securely store sensitive secret keys.