How can I query for products that are not visible?

Question:
How can I query for products that are not visible?

Product:
Editor X with Velo

What are you trying to achieve:
I want to be able to query for products that are not visible in the store, cause I want to be able to add them programmatically to the cart but I don’t want the customer to be able to view them. As it stands now when I query for the products (that are not visible), they won’t be returned.

What have you already tried:

import { products } from 'wix-stores.v2';

export async function getProductBySKU(sku) {
  const results = await products
    .queryProducts()
    .eq('sku', sku)
    .find();

  if (results.items.length > 0) {
    const items = results.items;
    return items;
  } else {
    // Handle if no matching items found
  }
}

This works great for visible products, but I need it to include hidden products too. And beyond the query, I’ll need to call the addProducts method on the FE to add the product to the cart, so I’m hoping that’s still possible for hidden products.

Additional information:
None

On the backend it’s possible to query the “Stores/Products” collection and include hidden products in it. This wouldn’t be available directly to the frontend as then any user could query for hidden products.

I’m not quite sure though if a user could add hidden products to their cart even if the items were passed to the frontend via a Velo Web Module.

Can you expand on the usecase a bit more? Would the ecom SPIs help achieve what you’re trying to do? wix-ecom - Velo SPI Reference - Wix.com