PHPackages                             creatuity/magento-2-cors-requests - 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. [API Development](/categories/api)
4. /
5. creatuity/magento-2-cors-requests

ActiveMagento2-module[API Development](/categories/api)

creatuity/magento-2-cors-requests
=================================

Enabling cross-origin resource sharing (CORS) requests to Magento 2 API from configured Origin domain

1.0.0(3y ago)017.3k↑119.9%OSL-3.0PHPPHP ^8.1

Since Jun 12Pushed 3y agoCompare

[ Source](https://github.com/creatuity/magento-2-cors-requests)[ Packagist](https://packagist.org/packages/creatuity/magento-2-cors-requests)[ Docs](https://github.com/creatuity/magento-2-cors-requests)[ RSS](/packages/creatuity-magento-2-cors-requests/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Magento 2 CORS Cross-Domain Requests
====================================

[](#magento-2-cors-cross-domain-requests)

Forked from **splashlab/magento-2-cors-requests**:

This module allows you to enable Cross-Origin Resource Sharing (CORS) REST API requests in Magento 2 by adding the appropriate HTTP headers and handling the pre-flight OPTIONS requests.

This can be used to allow AJAX and other requests to the Magento 2 REST API from another domain (or subdomain).

How to install
--------------

[](#how-to-install)

### 1. via composer

[](#1-via-composer)

Edit `composer.json`

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/creatuity/magento-2-cors-requests.git"
        }
    ],
    "require": {
        "creatuity/magento-2-cors-requests": "dev-master"
    }
}

```

```
composer install
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

```

### 2. Copy and paste

[](#2-copy-and-paste)

Download latest version from GitHub

Paste into `app/code/Creatuity/CorsRequests` directory

```
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

```

### 3. Update Origin URL

[](#3-update-origin-url)

In `Stores -> Configuration`, go to `General -> Web -> CORS Requests Configuration`.

Then edit the `CORS Origin Url` field to the domain you want to enable cross-domain requests from. (i.e. )

How does it work?
-----------------

[](#how-does-it-work)

The full implementation of CORS cross-domain HTTP requests is outside the scope of this README, but this is what this module does:

1. Allows configuring an Origin Url in the Admin Configuration area - this is the domain which cross-domain requests are permitted from
2. This domain is added to a `Access-Control-Allow-Origin` response HTTP header
3. Optionally you can enable the `Access-Control-Allow-Credentials` header as well, to enable passing cookies

For non-GET and non-standard-POST requests (i.e. PUT and DELETE), the "pre-flight check" OPTIONS request is handled by:

1. An empty `/V1/cors/check` API response with the appropriate headers:
2. `Access-Control-Allow-Methods` response header, which mirrors the `Access-Control-Request-Method` request header
3. `Access-Control-Allow-Headers` response header, which mirrors the `Access-Control-Request-Headers` request header

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

1119d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0998200db85ed30d30e182230c837875edd8abf02ca4d64389eccd730584e5cc?d=identicon)[creatuitydevelopers](/maintainers/creatuitydevelopers)

---

Top Contributors

[![thaddeusmt](https://avatars.githubusercontent.com/u/129787?v=4)](https://github.com/thaddeusmt "thaddeusmt (22 commits)")[![dchudycreatuity](https://avatars.githubusercontent.com/u/110817668?v=4)](https://github.com/dchudycreatuity "dchudycreatuity (4 commits)")[![gihovani](https://avatars.githubusercontent.com/u/2844128?v=4)](https://github.com/gihovani "gihovani (2 commits)")[![rodde177](https://avatars.githubusercontent.com/u/455527?v=4)](https://github.com/rodde177 "rodde177 (1 commits)")[![sebastian-ehrling](https://avatars.githubusercontent.com/u/20629208?v=4)](https://github.com/sebastian-ehrling "sebastian-ehrling (1 commits)")[![tszmyt-creatuity](https://avatars.githubusercontent.com/u/51603316?v=4)](https://github.com/tszmyt-creatuity "tszmyt-creatuity (1 commits)")[![floorz](https://avatars.githubusercontent.com/u/4982916?v=4)](https://github.com/floorz "floorz (1 commits)")[![nuovecode](https://avatars.githubusercontent.com/u/4451508?v=4)](https://github.com/nuovecode "nuovecode (1 commits)")

### Embed Badge

![Health badge](/badges/creatuity-magento-2-cors-requests/health.svg)

```
[![Health](https://phpackages.com/badges/creatuity-magento-2-cors-requests/health.svg)](https://phpackages.com/packages/creatuity-magento-2-cors-requests)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8064.7M49](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[graycore/magento2-cors

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

102597.6k](/packages/graycore-magento2-cors)[magmodules/magento2-channable

Channable integration for Magento 2

311.5M](/packages/magmodules-magento2-channable)[elgentos/module-prismicio

Magento 2 - Prismic.io integration

39119.0k4](/packages/elgentos-module-prismicio)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1328.7k](/packages/zepgram-module-rest)

PHPackages © 2026

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