Smootify.getCustomer()
the customer (null for a guest) once the session is known
the customer (null for a guest) once the session is known New in 2.0.
getCustomer(): Promise<Customer | null>Types
Customer
/** The logged-in customer (Shopify's customer accounts). */
export interface Customer {
/** `gid://shopify/Customer/<id>` */
id: string;
displayName: string;
firstName?: string | null;
lastName?: string | null;
tags: string[];
emailAddress?: { emailAddress: string; marketingState: MarketingState } | null;
phoneNumber?: { phoneNumber: string; marketingState: MarketingState } | null;
defaultAddress?: { id: string; name?: string | null; formatted: string[] | string } | null;
metafields: (CustomerMetafield | null)[];
companyContacts?: {
nodes: {
company: { id: string; name: string; metafields: (CustomerMetafield | null)[] } | null;
locations: { nodes: { id: string }[] };
}[];
} | null;
}