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< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): string | undefined { const buyerIdentity = useApi<Target>().buyerIdentity; if (!buyerIdentity) { throw new ScopeNotGrantedError( 'Using buyer identity requires having personal customer data permissions granted to your app.', ); } return useSubscription(buyerIdentity.phone); }