Initial reliable release of consent engine
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user