How to test buyerIdentity in checkout UI extension locally?

Shopify Expert
9 0 3

I'm in the early stages of building a checkout ui extension, specifically for the order status page.


I have the extension running locally and displaying correctly, however I really need to get the customer id or email given the use case of my app. I'm using a 'development' version of my app, however the customer details are always coming back as undefined.


According to the customer protected data page, to use it in development I need to select the fields I'd like to use in the partner dashboard, I don't need to submit it, which I have done and I can make requests to the admin api and see customer data.


Does anyone know of further steps I need to take for the useCustomer, or useEmail hooks to work when testing locally?





Replies 2 (2)

Shopify Expert
9 0 3

I think I may have answered my own question.


The useCustomer, useEmail and buyerIdentity only return a customer if they are logged in during the buying process. It doesn't return the customer associated with the order.

Shopify Partner
59 1 5

That is exactly correct , so basically require the store to have customer accounts mandatory !