I’m using a Checkout UI extension to build a form with email, password fields. My goal is to capture the customer login data directly in the checkout page, instead of having the customer go back to the Hydrogen storefront to use the login form and then return to the checkout page.
Using the checkout extension I’m able to use the Fetch API to interact with the Storefront API, to run the customerAccessTokenCreate mutation and the customer query to retrieve the customer information.
Is there a way to log in the user using the credentials captured in the checkout?
Hi @logang! UI Extensions are going to be limited in what they can access about the actual page they are rendered in. There is some detail here in the Security section about UI Extensions.
An alternative path is to build authentication flows in your storefront surfaces so that user authentication can persist throughout to the Checkout pages. You can additionally offer Shop Pay through Shopify Payments if you are able to, which allows for a streamlined authentication process within Checkout.
Ok got it we were hoping to be able to offer log in and sign up capabilities in the checkout flow so we don’t have to send them out of the checkout flow which seems to be a less than ideal user experience and affect some conversion rates.
if conversion rate is your concern, you could just prefill the address after you performed a “login” via the Storefront API - not optimal I know - but what we did for one of our clients.