@scaleway/cookie-consent
Advanced tools
Comparing version 2.0.1 to 2.0.2
# @scaleway/cookie-consent | ||
## 2.0.2 | ||
### Patch Changes | ||
- [#2041](https://github.com/scaleway/scaleway-lib/pull/2041) [`ca12d6d`](https://github.com/scaleway/scaleway-lib/commit/ca12d6d5b8e9679a9c12d619ad07d1c72b44c507) Thanks [@Slashgear](https://github.com/Slashgear)! - Cookie consent provider now work on client and server side | ||
## 2.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -10,2 +10,3 @@ import { jsx } from "react/jsx-runtime"; | ||
const HASH_COOKIE = `${COOKIE_PREFIX}_hash`; | ||
const IS_CLIENT = typeof document !== "undefined"; | ||
const CONSENT_MAX_AGE = 13 * 30 * 24 * 60 * 60; | ||
@@ -40,3 +41,3 @@ const CONSENT_ADVERTISING_MAX_AGE = 6 * 30 * 24 * 60 * 60; | ||
const [cookies, setCookies] = useState( | ||
cookie.parse(document.cookie) | ||
IS_CLIENT ? cookie.parse(document.cookie) : {} | ||
); | ||
@@ -43,0 +44,0 @@ const { |
{ | ||
"name": "@scaleway/cookie-consent", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "React provider to handle website end user consent cookie storage based on segment integrations", | ||
@@ -39,7 +39,7 @@ "main": "./dist/index.cjs", | ||
"react": "18.3.1", | ||
"@scaleway/use-segment": "1.1.0" | ||
"@scaleway/use-segment": "1.1.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "18.x || 18", | ||
"@scaleway/use-segment": "^1.1.0" | ||
"@scaleway/use-segment": "^1.1.1" | ||
}, | ||
@@ -46,0 +46,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
38867
748