A Magento 2 module that adds configurable CORS headers to the GraphQL and REST APIs for headless applications.
Magento 2 CORS is a module that adds configurable Cross-Origin Resource Sharing headers to Magento's GraphQL and REST APIs. It solves the common browser error where frontend applications cannot access Magento APIs due to missing CORS headers, enabling secure cross-origin requests. This is essential for building modern headless or decoupled e-commerce applications that interact with Magento from a separate frontend.
Magento 2 developers and agencies building headless or decoupled frontends (e.g., with React, Vue.js, or Next.js) that need to call Magento APIs directly from a browser. It's also for developers integrating third-party web applications with Magento's APIs.
Developers choose this module because it provides a secure, configurable, and standards-compliant way to enable CORS on Magento APIs without custom coding. It respects the full CORS protocol, includes security best practices by default, and is maintained with clear versioning and documentation.
A Magento 2 module that enables configurable CORS Headers on the GraphQL and REST APIs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows fine-grained CORS policy setting via configuration files for origins, methods, and headers, as detailed in the configuration documentation.
Implements all standard CORS headers including Access-Control-Allow-Credentials and Access-Control-Max-Age, ensuring compliance with browser security standards.
Designed with secure defaults to prevent misconfiguration, reducing the risk of unauthorized access, as emphasized in the security documentation.
Includes Vary: Origin header to maintain proper HTTP caching behavior with CORS, preventing cache poisoning issues as noted in the features.
Configuration must be done through files, not via Magento's admin panel, which is less convenient for non-developers or quick adjustments, as admitted in the FAQ.
Only works with Magento 2, so it's unsuitable for other e-commerce platforms or custom backends, limiting its broader applicability.
Requires editing configuration files and running Magento commands, which can be error-prone for teams without deep Magento expertise, despite the straightforward installation.