> ## Documentation Index
> Fetch the complete documentation index at: https://learn.biq.li/llms.txt
> Use this file to discover all available pages before exploring further.

# Consent management

> Delay, grant, withdraw, and clear browser tracking consent.

Biqli gives your consent manager explicit controls. Biqli does not decide which consent category or legal basis your site requires.

## Start without consent

```ts theme={null}
import {BiqliAnalytics} from '@biqli/analytics';

const biqli = new BiqliAnalytics({
  publishableKey: 'biqli_pk_xxxxxxxxx',
  consent: false,
});
```

Grant consent after your consent manager approves the relevant category:

```ts theme={null}
biqli.setConsent(true);
```

Withdraw it with:

```ts theme={null}
biqli.setConsent(false);
```

## Behavior while consent is disabled

The SDK:

* clears stored click attribution;
* clears queued browser events;
* does not decorate outbound links;
* rejects tracking calls with `consent_required`.

Granting consent captures an eligible `bq_id` still present in the current URL and resumes queue delivery. It cannot recover a click ID that has already been removed from both the page and storage.

## Script-tag setup

```html theme={null}
<script
  src="https://biq.li/sdk/dist/auto.global.js"
  data-publishable-key="biqli_pk_xxxxxxxxx"
  data-consent="false"
></script>
```

```js theme={null}
window.Biqli.setConsent(true);
```

## Consent versus manual startup

These options solve different problems:

* `consent: false` prevents attribution storage, outbound decoration, and event delivery.
* `manualStart: true` delays navigation listeners and automatic queue flushing until `start()` is called on the SDK instance.

Use the consent setting to represent consent state. Use manual startup when your application controls SDK lifecycle explicitly.
