@karatasemre/gord-sdk
v0.1.4
Published
GORD browser consent management SDK
Maintainers
Readme
@gord/sdk
Vanilla JavaScript consent management SDK for GORD.
Publish readiness
The package is configured for npm publication, but it is not published yet.
- Package name:
@gord/sdk - ESM entry:
dist/index.js - CommonJS entry:
dist/index.cjs - CDN/IIFE entry:
dist/sdk.global.js - Types:
dist/index.d.ts
Run a local package verification before publishing:
npm run build
npm run pack:drynpm
import GORD from '@gord/sdk';
GORD.init({
siteId: 'SITE_ID',
apiUrl: 'https://api.example.com',
language: 'tr',
debug: true,
autoBlock: true,
observeMutations: true,
consentTtlDays: 180
});CDN
<script
src="https://cdn.gord.dev/sdk.js"
data-site-id="SITE_ID"
data-language="tr"
data-api-url="https://api.example.com">
</script>Script blocking
<script type="text/plain" data-cookie-category="analytics" data-src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>Scripts are injected only after matching consent is granted.
Features
- Banner and Privacy Preference Center.
localStorage+ cookie consent persistence with TTL.- Backend consent log submission.
- Google Consent Mode v2 default/update signals.
type="text/plain"script unblocking.- Dynamic script and iframe blocking via
MutationObserver. - Provider classification for Google Analytics, GTM, Meta Pixel, TikTok Pixel, Hotjar, Clarity, LinkedIn Insight and Twitter Pixel.
- CDN auto-init with
data-site-id. - Global
window.Kookiealias.
Public API
init(options)showBanner()openPreferences()getConsent()updateConsent(partialConsent)revokeConsent()onConsentChange(callback)classifyResource(urlOrCode)
