# Hooks (/themes/sdk/reference/consent/hooks)

```ts
import { … } from '@poltura/theme-sdk/consent';
```

## `useConsent` [#useconsent]

The shopper's cookie consent.

```ts
useConsent(): ConsentState
```

It carries the merchant's banner wording, its look and the actions that record a choice. The host stores the choice in the consent cookie and gates every tracker by it; a theme only draws the choice.

**Returns:** The consent state and its actions.

**Example**

```tsx
import { useConsent } from '@poltura/theme-sdk/consent';

export function CookieSettingsButton() {
  const consent = useConsent();
  if (!consent.enabled) return null;
  return (
    <button type="button" onClick={consent.openPreferences}>
      {consent.texts.openPreferences || consent.texts.preferencesTitle}
    </button>
  );
}
```
