# Smootify.once()

> The once method of window.Smootify.

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/reference/api/methods/once  
Updated: 2026-10-13

New in 2.0.

```ts
once<N extends SmootifyEventName | SmootifyShortEventName>( name: N, handler: SmootifyEventHandler<N>, ): () => void
```

## Types

### SmootifyEventName

```ts
export type SmootifyEventName = keyof SmootifyEventMap;
```

### SmootifyShortEventName

```ts
/** A `smootify:` event by its name alone: `cart_updated`, `wishlist:changed_product`. */
export type SmootifyShortEventName = {
  [K in SmootifyEventName]: K extends `smootify:${infer Short}` ? Short : never;
}[SmootifyEventName];
```

### SmootifyEventHandler

```ts
export type SmootifyEventHandler<N extends SmootifyEventName | SmootifyShortEventName> = (
  payload: SmootifyEventMap[FullEventName<N>],
) => void;
```
