use-cookiescript-hook
v1.0.2
Published
React Hook for install banner from site https://cookie-script.com
Downloads
30
Readme
Installation
Using npm or yarn 📦
# Using npm
npm i use-cookiescript-hook
# Using yarn
yarn add use-cookiescript-hook
Usage
useCookieScript(url, options)
url: string,
options: {
position?: "head-top" | "head-bottom" | "body-bottom" //default: "body-bottom"
cookieName?: string //example: "CookieScriptConsent", default: "CookieScriptConsent"
language?: string //example: "en"
sameSite?: string //example: "lax", "strict", "none"
restrictDomain?: boolean, //example: true
}
Quickstart
import useCookieScript from "use-cookiescript-hook";
const App = () => {
useCookieScript("{your installation banner URL from the account}", {
position: "head-top",
})
return ("....");
}