Socket
Socket
Sign inDemoInstall

@taktikorg/tempore-veniam-in

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taktikorg/tempore-veniam-in

![publish workflow](https://github.com/taktikorg/tempore-veniam-in/actions/workflows/publish.yml/badge.svg) [![Test Coverage](https://api.codeclimate.com/v1/badges/807f879a42c4aa48c475/test_coverage)](https://codeclimate.com/github/lukaskupczyk/@taktikorg


Version published
Maintainers
1
Created
Source

publish workflow Test Coverage npm version MIT License

@taktikorg/tempore-veniam-in

React consent management solution and banner for cookies, local storage, session storage and (external) scripts.

@taktikorg/tempore-veniam-in Screenshot

Demo

Check out the CodeSandbox for a working example.

Documentation

Features

  • Provides the consent context to components
  • Loads (external) scripts based on consent state
  • Deletes cookies, local storage and session storage when consent declined
  • Hook to retrieve and change the current consent
  • Optional Banner with detailed settings to approve / decline consent
  • Persists the selection to local storage
  • Ready for Next.js
  • Dark and light mode
  • Styling via css

Installation

yarn add @taktikorg/tempore-veniam-in

# or

npm install @taktikorg/tempore-veniam-in

Basic usage

Wrap the application in the ConsentProvider. Provide settings via the options prop. Optionally use the ConsentBanner component to display a consent banner to the user.

/*
 * index.tsx
 */

import { ConsentBanner, ConsentProvider } from '@taktikorg/tempore-veniam-in';

// styling
import '@taktikorg/tempore-veniam-in/dist/styles/style.css';

// ...
<ConsentProvider
    options={{
        services: [
            {
                id: 'myid',
                name: 'MyName',
                scripts: [
                    { id: 'external-script', src: 'https://myscript.com/script.js' },
                    { id: 'inline-code', code: `alert("I am a JavaScript code");` },
                ],
                cookies: [{ pattern: 'cookie-name' }, { pattern: /regex/ }],
                localStorage: ['local-storage-key'],
                sessionStorage: ['session-storage-key'],
                mandatory: true,
            },
        ],
        // customHash: 'my-custom-hash', // optional, e.g. when changing the options based on language
        theme: 'light',
    }}
>
    <App />
    <ConsentBanner
        settings={{ hidden: false, label: 'More', modal: { title: 'Modal title' } }}
        decline={{ hidden: false, label: 'No' }}
        approve={{ label: 'Yes' }}
    >
        <>
            Can we use cookies and external services according to our <a href="test">privacy policy</a> to improve the
            browsing experience?
        </>
    </ConsentBanner>
</ConsentProvider>;
// ...

Keywords

FAQs

Package last updated on 12 Sep 2024

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