Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@use-cookie-consent/core

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@use-cookie-consent/core - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

6

package.json
{
"name": "@use-cookie-consent/core",
"version": "0.3.3",
"version": "0.3.4",
"description": "React hook for managing GDPR cookie consent state.",

@@ -12,5 +12,3 @@ "main": "./build/cjs/index.js",

"engines": {
"node": ">=12",
"npm": "<0",
"yarn": "^1"
"node": ">=12"
},

@@ -17,0 +15,0 @@ "scripts": {

@@ -10,2 +10,4 @@ # useCookieConsent hook for pure JavaScript projects

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/bring.shrubbery)
> Headless state management for GDPR cookie consent

@@ -78,6 +80,6 @@

<button onClick={acceptAllCookies}>Accept all</button>
<button onClick={() => acceptCookies({ thirdParty: true })}>
<button onClick={() => acceptCookies({ necessary: true, thirdParty: true })}>
Accept third-party
</button>
<button onClick={() => acceptCookies({ firstParty: true })}>
<button onClick={() => acceptCookies({ necessary: true, firstParty: true })}>
Accept first-party

@@ -91,2 +93,19 @@ </button>

### With custom cookie attributes
```tsx
import { useCookieConsent } from '@use-cookie-consent/core';
export const YourComponent = () => {
const { consent, acceptAllCookies, declineAllCookies, acceptCookies } = useCookieConsent({
consentCookieAttributes: { expires: 180 } // 180 days
});
return (
// ...
);
};
```
Cookie attributes for the underlying js-cookie package, more info [here](https://github.com/js-cookie/js-cookie).
## API

@@ -130,2 +149,3 @@

- [ ] Monorepo
- [x] Add package bundler ([rollup](https://rollupjs.org/) was added)

@@ -132,0 +152,0 @@ - [ ] Add support for Storage API

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc