Add programmatic consent API to @probo/cookie-banner

Expose a ConsentManager singleton via `@probo/cookie-banner/consent`
(ESM) and `window.Probo.consent` (IIFE) so customers can check and
react to consent state in their bundled JavaScript code, solving the
problem of third-party SDKs initialized programmatically that cannot
be blocked via data-cookie-consent attributes.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-13 14:59:48 +04:00
committed by Émile Ré
parent 2040931405
commit 4078567c04
5 changed files with 121 additions and 1 deletions

View File

@@ -38,6 +38,12 @@ await Promise.all([
outfile: "dist/cookie-banner-headless.mjs",
format: "esm",
}),
esbuild.build({
...shared,
entryPoints: ["src/consent.ts"],
outfile: "dist/cookie-banner-consent.mjs",
format: "esm",
}),
esbuild.build({
...shared,
entryPoints: ["src/themed-banner/iife.ts"],