Socket
Socket
Sign inDemoInstall

@weahead/react-cookie-consent-hook

Package Overview
Dependencies
Maintainers
9
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weahead/react-cookie-consent-hook

Cookie consent hook for react


Version published
Maintainers
9
Created
Source

A simple hook for managing cookies for consent.

Motivation

We wanted something as simple as a hook to manage consent cookies for our applications. We started using react-cookie but it was too broad for our use case, so this hook is inspired by react-cookie but more narrow in its use-case.

Features

  • Simple API for reading/writing cookies for consent management

API

Component

CookieConsentProvider

Wrap your app inside it.

Hook

useCookieConsent

Returns an array, similar to useState, with the first being cookies, an object with all cookies split in key/value pairs, and the second being setCookie, a function for setting a new cookie.

Keywords

FAQs

Package last updated on 01 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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