# swissup/module-upward-connector

> Magento module used for routing all frontend requests through UPWARD-PHP. Wrapper for magento/module-upward-connector

`composer require swissup/module-upward-connector`

Canonical URL: https://packagento.com/swissup/module-upward-connector

## At a glance

- **Vendor**: swissup (https://packagento.com/swissup.md)
- **Latest version**: 1.1.4 — released 2024-05-02
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/swissup/module-upward-connector and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require swissup/module-upward-connector:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento module used for routing all frontend requests through UPWARD-PHP. Wrapper for magento/module-upward-connector

## README

The Swissup 2 UPWARD connector extends and fix some functionatity of Magento 2 UPWARD connector.
The Magento 2 UPWARD connector is a module for routing requests to UPWARD-PHP. This module replaces the default Magento frontend theme with a PWA Studio storefront application.
PWA Studio storefront deployments in the Magento Commerce use this module to keep Magento and storefront code on the same server.


#### Contents

 1. [Installation](#installation)
 2. [Configuration](#configuration)

#### Installation

```bash
cd <magento_root>
composer config minimum-stability dev
composer config prefer-stable true
composer require swissup/module-upward-connector
composer config minimum-stability stable

bin/magento module:enable $(bin/magento module:status --disabled | grep 'Swissup_Core\|Pwa\|Aux\|Upward' | tr '\r\n' ' ')

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:clean

```

#### Configuration
The Magento 2 UPWARD connector has additional settings that can be configured in the admin area under:

Stores > Configuration > General > Web > UPWARD PWA Configuration.

##### UPWARD Config File

This configuration is the location of the UPWARD configuration file for the UPWARD-PHP server.

This module adds a new directive to the env.php to securely set the path to the upward.yaml file.
```php
    // ...
    'downloadable_domains' => [
        // ...
    ],
    # New configuration point
    'pwa_path' => [
        'default' => [
            'default' => '/var/www/html/pwa/dist/upward.yml'
        ],
        'website' => [
            '<website_code>' => '/var/www/html/anotherpwa/dist/upward.yml' # Can point a website to a different installation
        ],
        'store' => [
            '<store_code>' => '' # Blank string (or false) to serve default Magento storefront
        ]
    ]
```

For ease of use, this module provides a new command for setting the path
```shell
## Set the default scope to an empty string (will serve base Magento store front)
bin/magento pwa:upward:set

## Set the website with code <website_code> to /var/www/html/pwa/dist/upward.yml
bin/magento pwa:upward:set --path /var/www/html/pwa/dist/upward.yml --scopeType website --scopeCode <website_code>

## Set the website with code <website_code> to an empty string (will serve base Magento store front)
bin/magento pwa:upward:set --scopeType website --scopeCode <website_code>

## Set the website with code <store_code> to /var/www/html/pwa/dist/upward.yml
bin/magento pwa:upward:set --path /var/www/html/pwa/dist/upward.yml --scopeType store --scopeCode <store_code>
```

_You can use `bin/magento store:list` or `bin/magento store:website:list` to easily get the store/website code for configuration._

_You may use a path relative to your web root or an absolute path for the value of this configuration._
- Relative: `pwa/dist/upward.yml`
- Absolute: `/var/www/html/pwa/dist/upward.yml`

If you have previously configured the UPWARD yaml path using the `config:set` command or environment variables, it will continue to work as a fallback, so long as no
default has been set as per the example above.

The configuration works the same way normal store configurations work. It falls back from store view > website > global (default),
trying to serve the more specific available scope first.

##### Front Name Allowlist

This configuration allows you to specify a line-separated list of routes to forward to the default Magento theme.

Example:

```text
contact
privacy-policy-cookie-restriction-mode
```

With this example, when a visitor navigates to either `<Magento store URL>/contact` or `<Magento store URL>/privacy-policy-cookie-restriction-mode`, they will land on a page rendered by Magento instead of the storefront application.

#### Prerender.io Configuration

[Prerender.io][] support in the upward-connector module allows your site to send prerendered static html to search bots.

A middleware layer checks each request to see if it comes from a crawler and if allowed, sends it to the prerender service.
These configuration entries let you configure which pages to send to Prerender.io to serve the static HTML versions of that page.
If a page is not configured for prerendering, the request continues using the normal server routes.

| Configuration                    | Description                                                                                    | Example                       |
| -------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------- |
| Enable Prerender For Search Bots | This enables prerender functionality for this store view.                                      |                               |
| Prerender URL                    | Url of the prerender service.                                                                  | https://service.prerender.io/ |
| Prerender.io Token               | Token to use for the prenderer.io hosted service                                               |                               |
| Crawler User Agents              | Line break separated list of keywords to detect the crawler in the user-agent request header   |                               |
| Blocked List                     | Resources that will not be sent for prerendering. Use `*` as a wildcard character.             | `.js` `*/cart`                |
| Allowed List                     | Explicitly allowed resources to be sent for prerendering. If empty, all resources are allowed. |                               |

##### Testing prerendered pages

To see how a crawler sees a prerendered page, set your browser's User Agent to `Googlebot` and visit your URL.
You can also run this on the command line and change the sample URL to your storefront's URL:

```sh
curl -A Googlebot https://www.example.com/ > page.html
```

_(README truncated for .md surface. Full README on https://packagento.com/swissup/module-upward-connector.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.1.4 | 2024-05-02 |
| 1.1.3 | 2024-01-30 |
| 1.1.2 | 2024-01-11 |
| 1.1.1 | 2022-07-06 |
| 1.1.0 | 2022-05-18 |
| 1.0.0 | 2022-05-18 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-catalog | * |
| magento/module-catalog-url-rewrite-graph-ql | * |
| magento/module-cms | * |
| magento/module-config | * |
| magento/module-store | * |
| magento/module-upward-connector | * |
| magento/module-url-rewrite | * |
| magento/module-url-rewrite-graph-ql | * |
| magento/pwa | * |
| magento/upward | * |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0 |
| swissup/module-core | ^1.12.19 |
| swissup/module-pwa-studio-integration | ^1.0.0 |
| yireo/magento2-disable-service-worker-in-admin | ^0.0.2 |

## Quality

Latest release (1.1.4) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | not tested | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 3 | 3 warnings (ruleset: Magento2) |
| PHPMD | Warning | 3 | 3 rule violations (MissingImport:3) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 12 | valid; 12 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 42 | 42 | – | – |
| 2.4.8 | – | 42 | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["swissup/module-upward-connector"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

swissup is a Magento 2 vendor on Packagento. See https://packagento.com/swissup.md for their full catalogue.

