@consentry/next
Version:
Next.js + React integration layer for the Consentry SDK. Manages cookie preferences, script injection, and analytics sync.
25 lines (21 loc) • 1.01 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { ConsentConfig, CookiePreferences } from '@consentry/core';
export { ConsentCategory, ConsentConfig, ConsentScript, CookiePreferences } from '@consentry/core';
import { ReactNode } from 'react';
declare function Scripts({ config }: {
config: ConsentConfig;
}): react_jsx_runtime.JSX.Element | null;
declare const ConsentManagerProvider: ({ config, children, }: {
config: ConsentConfig;
children: ReactNode;
onConsentUpdate?: (prefs: CookiePreferences) => void;
}) => react_jsx_runtime.JSX.Element;
declare const useConsentManager: () => {
cookiePreferences: CookiePreferences;
setCookiePreferences: (prefs: CookiePreferences) => void;
setCategoryConsent: (category: keyof CookiePreferences, value: boolean) => void;
hasConsentedTo: (category: keyof CookiePreferences) => boolean;
showConsentBanner: boolean;
isConsentKnown: boolean;
};
export { ConsentManagerProvider, Scripts, useConsentManager };