Shopify / ui-extensions

MIT License
249 stars 35 forks source link

[Checkout UI] Surface a Customer access token for new Buyer Identity directive (B2B) #1877

Open gil-- opened 3 months ago

gil-- commented 3 months ago

Please list the related package(s)

checkout-ui-extensions

If this related to specific APIs or components, please list them here

Provide a compatible customer access token to run buyer specific storefront api queries - https://shopify.dev/docs/custom-storefronts/headless/b2b#step-3-contextualize-storefront-api-requests

Is your feature request related to a problem? Please describe.

I'd like to retrieve buyer contextualized product data using the Storefront api in checkout.

Describe the changes you are looking for

Surface a useCustomerAccessToken() to include in Storefront api calls within checkout extensions

Describe alternatives you’ve considered

Maybe I'm doing something wrong but I tried https://shopify.dev/docs/api/checkout-ui-extensions/unstable/apis/session-token and it didn't seem to work.

CleanShot 2024-04-03 at 12 17 47@2x

dio5 commented 1 month ago

I'm facing a similar issue in where I want to grab more customer data from the storefront api but don't seem to have a customer access token available in checkout ui extension. Did you find a way to get it? (Other than building a backend app.)

Ciull0 commented 1 month ago

I'd also like to access the customer access token in the checkout, to retrieve data from customer not accessible in any other way (such as associated metaobjects)