Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I use Next.js together with the Headless app and React-Hydrogen to build a Shopify storefront website.
React Hydrogen manages the cart automatically, by storing the cart id in local storage.
If the user clears their local storage, this cart is gone. I want to provide a way for users to log in and keep their cart permanently.
My first idea was to use my implement authentication solution, store the user accounts in my own DB, and store the cart id in the user table.
But there is also Customer Account API and I'm not sure if that would be a better choice for my use case. Can someone enlighten me?
Hey @FlorianWalther
That's a planned feature for Customer Account API but it's not quite ready yet. You'll have to roll your own solution. Keep in mind cart IDs expire after 10 days. Good luck!
Scott | Developer Advocate @ Shopify