Searching for a way to add products to cart and sending the csrf token with ajax
So normally in your main layout twig template, you'd have something like this to set some JS variables to hold the current CSRF token:
    {# Super preliminary JS Stuff #}
    &lt;script type=&quot;text/javascript&quot;&gt;
        window.csrfTokenName = &quot;{{ craft.app.config.general.csrfTokenName|e('js') }}&quot;;
        window.csrfTokenValue = &quot;{{ craft.app.request.csrfToken|e('js') }}&quot;;
        window.cartId = &quot;{{ cart.id }}&quot;;
    &lt;/script&gt;

Then, in your add-to-cart JS, you do something along the lines of this to add those variables to the form data:
   formData.push({
     name: window.csrfTokenName,
     value: window.csrfTokenValue
   })

Craft's own documentation for this is here:
https://craftcms.com/knowledge-base/enabling-csrf-protection#updating-your-javascript