PHPackages                             leventures/magento2-cors - 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. leventures/magento2-cors

ActiveMagento2-module

leventures/magento2-cors
========================

A Magento 2 module that enables CORS on the GraphQL and REST Apis

1.0.1(6y ago)0191[8 PRs](https://github.com/leventures/magento2-cors/pulls)MITPHPPHP &gt;=7.0.0

Since Jul 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/leventures/magento2-cors)[ Packagist](https://packagist.org/packages/leventures/magento2-cors)[ RSS](/packages/leventures-magento2-cors/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (11)Used By (0)

Magento 2 CORS
==============

[](#magento-2-cors)

[![Total Downloads](https://camo.githubusercontent.com/0d723a6ea5b20318a59338788beb421aee12752fc8b41ffbfa2bb6131597515a/68747470733a2f2f706f7365722e707567782e6f72672f67726179636f72652f6d6167656e746f322d636f72732f646f776e6c6f616473)](https://packagist.org/packages/graycore/magento2-cors)

Ever try to work with the Magento v2.3+ GraphQL API from your browser and see the following?

```
Access to XMLHttpRequest at 'https://my.magento.app' from origin 'http://my.local.env' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
```

This package allows you to add the necessary CORS headers to Magento 2 with ease.

Purpose
-------

[](#purpose)

When building a headless application for Magento, or working with a client that respects the CORS protocol, you will need [CORS headers](https://fetch.spec.whatwg.org/#http-cors-protocol) on your backend resource.

This package will add configurable CORS Resource headers to the Magento 2 GraphQL API, allowing you to access the GraphQL API from your browser.

Getting Started
---------------

[](#getting-started)

This module is intended to be installed with [composer](https://getcomposer.org/). From the root of your Magento 2 project:

1. Download the package

```
composer require leventures/magento2-cors
```

2. [Configure the package](/docs/stories/configuring-the-headers.md)
3. Enable the package

```
./bin/magento module:enable Graycore_Cors
```

Features
--------

[](#features)

- [Configurable](./docs/stories/configuring-the-headers.md)
- [Respects the full CORS Protocol](https://fetch.spec.whatwg.org/#http-cors-protocol)
    - `Access-Control-Allow-Origin`
    - `Access-Control-Allow-Methods`
    - `Access-Control-Allow-Headers`
    - `Access-Control-Max-Age`
- [Security By Default](./docs/stories/security.md#security-by-default)

Helpful Links
-------------

[](#helpful-links)

- [FAQ](./docs/faq/faqs.md)
    - [Can I configure this from the admin panel?](./docs/faq/faqs.md#can-i-configure-this-from-the-admin-panel)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.2% 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 ~127 days

Total

2

Last Release

2354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a947f191a366c744d92e2cd1da2f2c7dffd77da5facd0aeaa5e316d9ab34779?d=identicon)[leventures](/maintainers/leventures)

---

Top Contributors

[![damienwebdev](https://avatars.githubusercontent.com/u/9029654?v=4)](https://github.com/damienwebdev "damienwebdev (15 commits)")[![khoi-le](https://avatars.githubusercontent.com/u/13313531?v=4)](https://github.com/khoi-le "khoi-le (7 commits)")[![kniziol](https://avatars.githubusercontent.com/u/947620?v=4)](https://github.com/kniziol "kniziol (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/leventures-magento2-cors/health.svg)

```
[![Health](https://phpackages.com/badges/leventures-magento2-cors/health.svg)](https://phpackages.com/packages/leventures-magento2-cors)
```

PHPackages © 2026

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