Product Filter by Metafields

New Member
13 0 0

I'm trying to filter the results of my collection page by the value of the products' metafields, similar to this: 

I've got the metafields created, and plan on having them all in the same namespace for organization's sake, however, how can I efficiently capture all keys and values to create the filter inputs? Is the best way to just data attributes on each product or create a hidden element with the metafield values, and then read them with JS?