Shopify / ui-extensions

MIT License
268 stars 36 forks source link

Feature Request: Add Customer Tags to `useCustomer` Hook in Checkout UI API #2316

Open mahbub-1 opened 2 months ago

mahbub-1 commented 2 months ago

Related Package(s)

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

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

Currently, the useCustomer hook in the Checkout UI Extensions API provides essential customer information such as id, image, name, and phone. However, it does not return customer tags, which limits the ability to segment and personalize the checkout experience based on customer groups. This gap in functionality is particularly frustrating when trying to tailor checkout experiences for specific customer segments, such as VIP customers or frequent buyers.

Describe the changes you are looking for

I would like to request the addition of a tags field to the useCustomer hook. This field would return an array of tags associated with the customer. For example:

const customer = useCustomer();

console.log(customer.tags); // ['VIP', 'Frequent Buyer', 'Newsletter Subscriber']

This enhancement would allow developers to create more personalized and dynamic checkout experiences based on customer segmentation.

Describe alternatives you’ve considered

Currently, the lack of customer tags in the useCustomer hook forces developers to rely on external APIs or additional backend logic to retrieve customer tags. These alternatives increase complexity and latency, making the development process more cumbersome and less efficient.

Additional context

Adding customer tags to the useCustomer hook would greatly enhance the flexibility of the Checkout UI Extensions API, enabling more robust and personalized customer experiences. This feature would align with the need for greater customization capabilities within the Shopify ecosystem.

GorgonFreeman commented 1 month ago

I'd like to agree with this. Tags are basic categorisation, makes perfect sense to have access to that info in checkout.