PHPackages                             omatech/oma-cookies - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. omatech/oma-cookies

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

omatech/oma-cookies
===================

Cookie consent manager

v1.3.1(4y ago)07MITJavaScript

Since Mar 17Pushed 4y ago5 watchersCompare

[ Source](https://github.com/omatech/oma-cookies)[ Packagist](https://packagist.org/packages/omatech/oma-cookies)[ RSS](/packages/omatech-oma-cookies/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (11)Used By (0)

[![Omatech Logo](https://camo.githubusercontent.com/2ca51939f89263b8e58fdb466f13a25db9a63dc2bb78c393524e3e956ab2e591/68747470733a2f2f6d656469612d657870312e6c6963646e2e636f6d2f646d732f696d6167652f43344430424151467856726553447030385f772f636f6d70616e792d6c6f676f5f3230305f3230302f302f313634363831373836343830343f653d3136353437333238303026763d6265746126743d4d4f6f4d7a415873534f7063426a39726f3335304b7939386a4e4a70334c4f324977624c5f72363154654d)](https://github.com/omatech/oma-cookies)Oma-cookies
===========

[](#oma-cookies)

Built-in solution that allows the control of cookies,
enabling GDPR compliance for Omatech internal projects.

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [JavaScript import](#js-import)
    - [CSS/SASS import](#css-import)
- [Implementation](#implementation)
    - [Iframes](#iframes)
    - [Scripts](#scripts)
- [Methods](#methods)
    - [Open cookies consent selection modal](#method-open-consent)
- [Configuration](#configuration)
    - [Override language strings](#lang-strings)
    - [Adding a new language](#add-lang)
    - [Setting the default language](#default-lang)
    - [Read more link](#read-more)
    - [Format](#format)
    - [Quick link position](#quick-link)
- [License](#license)
- [Contact](#contact)

Installation
------------

[](#installation)

Install the package

```
npm i @omatech/oma-cookies

```

### JavaScript import

[](#javascript-import)

Import the main js file into your project:

```
require('@omatech/oma-cookies/dist/js/omacookies.min');
```

Optionally you can copy into a public folder the JS file located inside the `/node_modules/@omatech/oma-cookies/dist/js` folder and link it in your HTML layout

```

```

### CSS/SASS import

[](#csssass-import)

There are 2 approaches depending on your styling method:

**A) If you are *ONLY* overriding CSS classes =&gt; Import the compiled CSS file**

```
@import "~@omatech/oma-cookies/dist/css/omacookies.min.css"
```

Optionally you can copy into a public folder the CSS file located inside the `/node_modules/@omatech/oma-cookies/dist/css` folder and link it in your HTML layout

```

```

**B) If you want to override the variables and CSS classes =&gt; Import all the separated files**

```
@import "~@omatech/oma-cookies/dist/scss/base"
@import "~@omatech/oma-cookies/dist/scss/variables"
//Your own SCSS file overriding the variables from the file above
@import "variables"
@import "~@omatech/oma-cookies/dist/scss/styles"
```

### Regardless of what option you choose, make sure this line is in your HTML layout so the responsive works properly.

[](#regardless-of-what-option-you-choose-make-sure-this-line-is-in-your-html-layout-so-the-responsive-worksproperly)

```

```

Implementation
--------------

[](#implementation)

To start things up, you must add this somewhere in your HTML layout (preferably at the end)

```

...

```

### Iframes

[](#iframes)

Every iframe must have the attribute `data-omacookies-consent` which has 2 possible values `marketing`or `statistics`. This specitfy when the content will be un/blocked

#### YouTube videos

[](#youtube-videos)

The attribute `data-omacookies-yt-video-id` is the ID found at the end of every YouTube video URL. In `/watch?v=uu5k19UaCT0`the ID would be `uu5k19UaCT0`

```

```

#### Generic iframe

[](#generic-iframe)

The attribute `data-omacookies-src` would work as the normal iframe `src` attribute

You can add any attribute to the rendered iframe using the attribute `data-omacookies-xxx`. Simply change `xxx`for any other attribute. See the attribute `width` shown in the example.

```

```

### Scripts

[](#scripts)

**It is required to add the `type="text/plain"` attribute.**

- For **file** JavaScript scripts

```

```

- For **inline** JavaScript code

```

    console.log("Hello World!");

```

[↑ Back to top](#top)

Methods
-------

[](#methods)

### Open cookies consent selection modal

[](#open-cookies-consent-selection-modal)

```
window.OMAC.SelectionModal.open();
```

[↑ Back to top](#top)

Configuration
-------------

[](#configuration)

Somewhere after the import of the `omacookies` JS file we will override attributes from the main object.

### Override language strings

[](#override-language-strings)

We can set a new value for any language string with the following declaration:

```
window.OMAC.available_languages.es.select_box_title = 'Personalizar Cookies';
```

### Adding a new language

[](#adding-a-new-language)

We can add as many languages as we want, we just need to follow the same object structure we already have for ES and EN.

You can copy the structure from `/node_modules/@omatech/oma-cookies/src/lang/en.json`

For example, we will add German language:

```
window.OMAC.available_languages.de = {
    "constent_box_title": "Diese Website verwendet Cookies",
    ...
};
```

### Setting the default language

[](#setting-the-default-language)

Make sure to set the language **after** you make any modifications to the `available_languages` object.

```
window.OMAC.setLang("en");
```

### Read more link

[](#read-more-link)

Here we will add the website link where the user will be redirected to read the cookie policy.

```
window.OMAC.readMoreLink = "https://omatech.com/cookies.html";
```

### Format

[](#format)

Here we can set the appearance of the initial cookie dialog. The allowed values are `modal` (default) or `banner`.

```
window.OMAC.format = "banner";
```

### Enable/disable quick link

[](#enabledisable-quick-link)

The quick link is enabled by default. Disable it setting the following:

```
window.OMAC.enableQuickLink = false;
```

*To open the cookies selection modal when disabled, use the [this method](#method-open-consent)*

### Quick link position

[](#quick-link-position)

Here we can configure in which corner of the screen will the quick link be located, using the values `top-right`, `top-left`, `bottom-right` or `bottom-left`. The quick link will appear on the `bottom-right` by default.

```
window.OMAC.quickLinkPosition = "bottom-left";
```

[↑ Back to top](#top)

License
-------

[](#license)

This project has MIT license. For further information, read the `LICENSE` file.

[↑ Back to top](#top)

Contact
-------

[](#contact)

- Website: [www.omatech.com](https://www.omatech.com)
- Email:
- LinkedIn: [LinkedIn Omatech](https://www.linkedin.com/company/omatech.com/)
- Project Link: [GitHub Oma-cookies](https://github.com/omatech/oma-cookies)

[↑ Back to top](#top)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

9

Last Release

1557d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a6b2440a7864015d71501a9cd77d28bed549c283afdd8d1af95f54b650dc833?d=identicon)[aponscat](/maintainers/aponscat)

---

Top Contributors

[![alorman-omatech](https://avatars.githubusercontent.com/u/39263406?v=4)](https://github.com/alorman-omatech "alorman-omatech (26 commits)")[![sarayjrz](https://avatars.githubusercontent.com/u/60918667?v=4)](https://github.com/sarayjrz "sarayjrz (5 commits)")

### Embed Badge

![Health badge](/badges/omatech-oma-cookies/health.svg)

```
[![Health](https://phpackages.com/badges/omatech-oma-cookies/health.svg)](https://phpackages.com/packages/omatech-oma-cookies)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
