# smootify:user_auth_change

> the session is known or changed: the customer, null for a guest

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/reference/api/events/user-auth-change  
Updated: 2026-10-13

the session is known or changed: the customer, null for a guest Since 1.x.

## Listen

```js
window.Smootify = window.Smootify || [];
window.Smootify.push((api) => {
  api.on("user_auth_change", (payload) => {
    // …
  });
});
```

## Payload

```ts
Customer | null
```

### Customer

```ts
/** 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;
}
```
