@afex-dapps/cookie
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@afex-dapps/cookies

@afex-dapps/cookies is a lightweight utility library designed to simplify the implementation of common components in our application.

Exports

The library exports a CookieBanner component that helps you manage cookie consent for your users, utilizing configuration options inspired by vanilla-cookieconsent.

Installation

To install @afex-dapps/cookies, run the following command:

npm i afex-utils

Usage

Importing the Component

You can import the CookieBanner component from afex-utils into your main application file, such as App.tsx or main.tsx.

import React from 'react';
import { CookieBanner } from 'afex-utils';

{/* Example Configuration */}
const configuration= {
   categories: {
        necessary: {
            enabled: true,  // this category is enabled by default
            readOnly: true  // this category cannot be disabled
        },
        analytics: {}
    },
   language: {
        default: 'en',
        rtl: 'ar',
        autoDetect: 'browser',
        translations: {
            en: '/assets/translations/en.json',
            ar: '/assets/translations/ar.json'
        }
    }
}

function App() {
  return (
    <div>
      <CookieBanner configuration={configuration} />
      {/* Other components in your app */}
    </div>
  );
}

export default App;

Contributing

If you'd like to contribute to @afex-dapps/cookies, please fork the repository and submit a pull request. We welcome all contributions!

License

@afex-dapps/cookies is released under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i @afex-dapps/cookie

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

345 kB

Total Files

7

Last publish

Collaborators

  • afex-dapps