Initial reliable release of consent engine

This commit is contained in:
Deyson Thomé
2026-09-02 14:19:05 -03:00
commit 9e1082d47b
22 changed files with 3377 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
/**
* Universal Cookie Consent
* integration/index.js
*
* Public integration API.
*
* Jurisdiction resolution is performed before the Consent Core is created.
* The resolved jurisdiction becomes Core configuration; it does not become
* a consent decision.
*/
import { createConsentEngine } from "../core/consent.js";
import { resolveConsentContext } from "./context.js";
export { resolveConsentContext } from "./context.js";
export function createIntegratedConsentEngine({
jurisdiction = {},
core = {}
} = {}) {
const context = resolveConsentContext(jurisdiction);
const engine = createConsentEngine({
...core,
jurisdiction: context.resolution.jurisdiction.id
});
return Object.freeze({
...engine,
getJurisdictionContext() {
return context;
}
});
}