setConsent
Allow or deny analytics capture, storage, and network.
Set consent
import { setConsent } from "@hyperreal/landscape-core";
setConsent({ analytics: false });
setConsent({ analytics: true });
Signature
function setConsent(state: ConsentState): void
interface ConsentState {
analytics: boolean;
}
Defaults
Consent is persisted in config storage under the key consent (packages/core/src/consent.ts).
Behavior
When analytics is false, the pipeline does not emit, write the durable queue, or send analytics requests.
When analytics becomes true, Landscape drains the durable queue.
Read state with getClient()?.getConsent() or client.getConsent().