# Smootify.setConsent()

> The setConsent method of window.Smootify.

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

New in 2.0.

```ts
setConsent(choices: ConsentChoices): Promise<ConsentSnapshot>
```

## Types

### ConsentSnapshot

```ts
/** The visitor's consent, from Shopify's Customer Privacy API. */
export interface ConsentSnapshot {
  /** Shopify's script answered */
  loaded: boolean;
  /** the visitor's region asks for consent and it is not given yet (the banner shows) */
  required: boolean;
  /** US privacy laws: the "do not sell my data" choice applies */
  saleOfDataRegion: boolean;
  region: string;
  answers: Record<ConsentKey, ConsentAnswer>;
  allowed: Record<ConsentKey, boolean>;
  /** the visitor answered at least one category */
  interacted: boolean;
}
```

### ConsentChoices

```ts
export type ConsentChoices = Partial<Record<ConsentKey, boolean>>;
```
