---
title: "Consent and privacy"
description: "Configure consent and privacy controls in Tracwell."
documentation: "https://tracwell.app/docs/privacy"
markdown: "https://tracwell.app/docs/privacy.md"
---

# Consent and privacy

> Configure consent and privacy controls in Tracwell.

## Require consent

Tracwell respects Do Not Track by default. Start with `required` consent when a consent flow must run before collection.

```ts
const analytics = createTracwell({
  collectionMode: "product",
  consent: "required",
  projectKey: "tw_live_...",
});

analytics.setConsent("granted");
```

Call `setConsent("denied")` when consent is withdrawn. Tracwell stops listeners, removes queued events, and resets identity.

## Collect only what you need

The privacy notice should describe the collection mode, identity behavior, and configured custom events. Never put sensitive data or secrets in event properties.
