Socket
Socket
Sign inDemoInstall

@weahead/react-cookie-consent-hook

Package Overview
Dependencies
3
Maintainers
9
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @weahead/react-cookie-consent-hook

Cookie consent hook for react


Version published
Weekly downloads
2
Maintainers
9
Created
Weekly downloads
 

Readme

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

Last updated on 03 Aug 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc