Returns the email address 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 email address 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 useEmail< 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.email); }