How to add custom attributes using Buy Button JS

I’ve built an integration using the Buy Button JS, and it all works great. However, I’d like each line item to link back to their (CMS) product url (like foo.com/product/23554332). I found this: https://github.com/Shopify/buy-button-js/issues/598#issuecomment-637213382 and I’ve implemented it and I can see that the custom attributes will be available in my cart, which is great.

However, how does one add custom attributes to each product?

Hi @edalzell did you find a solution for this? I’m having the same issue with adding custom text as a line item to a product. The property is not showing up in the order.