Socket
Socket
Sign inDemoInstall

@code-202/cookie-consent

Package Overview
Dependencies
29
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @code-202/cookie-consent

Rich cookie consent with react/mobx and bootstrap design


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Rich cookie consent with react / mobx and bootstrap design

Store injection

Launcher and Dialog components use the @code-202/kernel to get the store service with code 'cookie-consent' Add it in your container like this

    const cookieConsentStore = new CookieConsentStore({ cookie: { secure: false }, cookies: kernel.environment.get('cookies') })

    cookieConsentStore.addService({
        id: 'main',
        needConsent: false,
        type: 'main',
        name: 'Fonctionnement',
        cookies: ['rmcc', 'api-token']
    })

    cookieConsentStore.addService({
        id: 'ga',
        needConsent: true,
        type: 'analytics',
        name: 'Google Analytics',
        cookies: ['_ga', '_gid'],
        onAccept: () => {
            console.log('enable GA')
            //ga.enable()
        },
        onDecline: () => {
            console.log('disable GA')
            //ga.disable()
        }
    })

    kernel.container.add('cookie-consent', cookieConsentStore)

FAQs

Last updated on 09 May 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