Returns the phone number of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data.
Returns the phone number of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data.
export function usePhone< ID extends RenderExtensionPoint = RenderExtensionPoint, >(): string | undefined { const buyerIdentity = useApi<ID>().buyerIdentity; if (!buyerIdentity) { throw new ScopeNotGrantedError( 'Using buyer identity requires having personal customer data permissions granted to your app.', ); } return useSubscription(buyerIdentity.phone); }