async function forwardWebhook({ body }) {
  const sendSentry = (err) => {
    captureSentry(err, 'forwardWebhook', {
      ...body,
      webhookUrl: process.env.WEBHOOK_TEST_URL,
    });
  };

  if (!process.env.WEBHOOK_TEST_URL) {
    sendSentry('Webhook forwarding requires WEBHOOK_TEST_URL env var');
    return false;
  }

  try {
    const response = await fetch(process.env.WEBHOOK_TEST_URL, {
      method: 'post',
      body: JSON.stringify(body),
      headers: { 'Content-Type': 'application/json' },
    });
    const text = await response.text();
    if (text !== 'ok') {
      sendSentry('Bad response from webhook forwarding');
      return false;
    }
    return true;
  } catch (err) {
    sendSentry(err);
    return false;
  }
}
/**
 * Forward a received webhook for testing on another dev tier
 *
 * @param {Object} body Body JS from original POST received
 */
Forward a received webhook for testing on another dev tier
@param {Object} body Body JS from original POST received
Forward a received webhook for testing on another dev tier @param { Object } body Body JS from original POST received
async function forwardWebhook({ body }) {
  const sendSentry = (err) => {
    captureSentry(err, 'forwardWebhook', {
      ...body,
      webhookUrl: process.env.WEBHOOK_TEST_URL,
    });
  };
  if (!process.env.WEBHOOK_TEST_URL) {
    sendSentry('Webhook forwarding requires WEBHOOK_TEST_URL env var');
    return false;
  }
  try {
    const response = await fetch(process.env.WEBHOOK_TEST_URL, {
      method: 'post',
      body: JSON.stringify(body),
      headers: { 'Content-Type': 'application/json' },
    });
    const text = await response.text();
    if (text !== 'ok') {
      sendSentry('Bad response from webhook forwarding');
      return false;
    }
    return true;
  } catch (err) {
    sendSentry(err);
    return false;
  }
}
async function forwardWebhook ( { body } ) { const sendSentry = ( err ) => { captureSentry ( err , 'forwardWebhook' , { ... body , webhookUrl : process . env . WEBHOOK_TEST_URL , } ) ; } ; if ( ! process . env . WEBHOOK_TEST_URL ) { sendSentry ( 'Webhook forwarding requires WEBHOOK_TEST_URL env var' ) ; return false ; } try { const response = await fetch ( process . env . WEBHOOK_TEST_URL , { method : 'post' , body : JSON . stringify ( body ) , headers : { 'Content-Type' : 'application/json' } , } ) ; const text = await response . text ( ) ; if ( text !== 'ok' ) { sendSentry ( 'Bad response from webhook forwarding' ) ; return false ; } return true ; } catch ( err ) { sendSentry ( err ) ; return false ; } }
Forward a received webhook for testing on another dev tier
 @param {Object} body Body JS from original POST received
Forward a received webhook for testing on another dev tier @param { Object } body Body JS from original POST received