Skip to content

Conversation

@RomanDenysov
Copy link
Owner

Summary

  • Flat top-level API: consent.get(), consent.set(), consent.clear(), consent.isGranted(), consent.guard(), consent.subscribe() — no more consent.client.* / consent.server.* for common operations
  • Google Consent Mode v2 in core: enableConsentMode and defaultConsentModeMapping moved from @consentify/gtm into @consentify/core
  • Removed @consentify/gtm package entirely (use @consentify/core flat API directly)
  • Bundle optimization: deduplicated cookie header construction + removeComments in build config → 3.4 kB gzipped (was 3.9 kB)
  • 82 tests covering flat API, enableConsentMode, error handling, edge cases

Breaking Changes

  • @consentify/gtm is removed — use enableConsentMode from @consentify/core
  • The server/client namespaces still work but the flat API is now primary

Test plan

  • pnpm -r build — all packages build clean
  • pnpm test — 82 tests pass
  • Verify npm deprecate @consentify/gtm after merge
  • Tag core-v* to trigger release

🤖 Generated with Claude Code

- Add flat top-level methods (get, set, clear, isGranted, guard, subscribe,
  getServerSnapshot) with function overloads for precise return types
- Move enableConsentMode and defaultConsentModeMapping from @consentify/gtm
  into @consentify/core
- Export ConsentifySubscribable interface for adapters
- Update React hook to consume flat API
- Deduplicate cookie header construction (buildSetCookieHeader)
- Add removeComments to build config (-11.7% gzip size)
- Remove @consentify/gtm package and release workflow trigger
- Update README with flat API examples and Google Consent Mode v2 docs
- 82 tests passing

BREAKING CHANGE: @consentify/gtm is removed. Use enableConsentMode from
@consentify/core instead. The server/client namespaces are still available
but the flat API is now the primary interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RomanDenysov RomanDenysov merged commit 756bdd1 into main Feb 7, 2026
2 checks passed
@RomanDenysov RomanDenysov deleted the feat/flat-api branch February 7, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant