PHPackages                             actuatedigital/module-salesfire-hyva - 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. actuatedigital/module-salesfire-hyva

ActiveMagento2-module

actuatedigital/module-salesfire-hyva
====================================

Hyvä theme compatibility for the Salesfire (Salesfire\_Salesfire) Magento 2 module. Replaces the RequireJS/jQuery/Knockout-based sfgetid and cart-tracking scripts with plain, CSP-safe scripts that use Hyvä's private-content-loaded event.

1.0.0(yesterday)00MITPHP &gt;=8.1

Since Jul 22Compare

[ Source](https://github.com/actuatedigital/module-salesfire-hyva)[ Packagist](https://packagist.org/packages/actuatedigital/module-salesfire-hyva)[ Docs](https://github.com/actuatedigital/module-salesfire-hyva)[ RSS](/packages/actuatedigital-module-salesfire-hyva/feed)WikiDiscussions Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Actuate\_SalesfireHyva
======================

[](#actuate_salesfirehyva)

Hyvä theme compatibility for the **Salesfire** Magento 2 module (`salesfire/magento2`, module `Salesfire_Salesfire`).

Why this is needed
------------------

[](#why-this-is-needed)

`Salesfire_Salesfire` injects a head script (`Salesfire\Salesfire\Block\Script`) that emits three things:

1. The Salesfire beacon + product/transaction data (via `\Salesfire\Formatter`) — **theme agnostic, works fine in Hyvä.**
2. `require(['sfgetid'], …)` — bootstraps the Salesfire customer id.
3. `window.sfData.currency = …; require(['sfcarttracking'])` — bootstraps add/remove‑from‑cart tracking.

Items **2** and **3** rely on RequireJS, and the cart tracker additionally depends on jQuery and Knockout `Magento_Customer/js/customer-data`. None of those exist in a Hyvä storefront, so in Hyvä those two bootstraps throw `require is not defined` and Salesfire never receives a customer id or cart events. This breaks Salesfire audiences/personalisation and cart analytics while leaving the core beacon working — so the failure is easy to miss.

What this module does
---------------------

[](#what-this-module-does)

It overrides **only** the two broken emitters with plain, CSP‑nonce'd inline scripts that use Hyvä's native mechanisms:

Original (Luma)Hyvä replacement`sfgetid.js` — `define(['mage/url'])`, fetch `/salesfire/ajax/sfgetid`Plain `fetch()` of the same endpoint (`getid.phtml`)`cart-tracking.js` — Knockout `customerData.get('cart').subscribe`Listens to Hyvä's `private-content-loaded` window event and diffs `event.detail.data.cart` (`cart-tracking.phtml`)The Salesfire beacon and product/transaction payload (item 1) are inherited **unchanged** from the vendor block — no logic is duplicated and the vendor module is **not patched**.

How it works
------------

[](#how-it-works)

- `Actuate\SalesfireHyva\Block\Script` extends `Salesfire\Salesfire\Block\Script` and overrides `initSfGetIdScript()` / `initSfAddToCartScript()` to render the two templates above.
- `view/frontend/layout/hyva_default.xml` removes the original `salesfire_script` block and adds the subclass. The `hyva_default` layout handle **only** applies under the Hyvä theme, so a Luma storefront keeps the original RequireJS behaviour untouched — no runtime theme checks.
- Inline scripts reuse the CSP nonce already generated by the parent block (Magento ≥ 2.4.7), so they are compatible with a strict Content‑Security‑Policy.

Requirements
------------

[](#requirements)

- `salesfire/magento2` `^1.4` (module `Salesfire_Salesfire`)
- A Hyvä theme (`hyva-themes/magento2-theme-module`) — the module is inert without it.

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

[](#installation)

Via Composer (once published to your repository / Packagist):

```
composer require actuate/module-salesfire-hyva
bin/magento module:enable Actuate_SalesfireHyva
bin/magento setup:upgrade
```

Or drop the module into `app/code/Actuate/SalesfireHyva` and run the same `module:enable` / `setup:upgrade`.

Verifying
---------

[](#verifying)

On the Hyvä storefront, with the browser console open:

- No `require is not defined` errors from the Salesfire head script.
- `localStorage.getItem('sf_cuid')` is populated and `window.sfDataLayer` contains a `session.id` entry.
- Adding/removing a cart item pushes an `ecommerce.add` / `ecommerce.remove` entry into `window.sfDataLayer`.

Licence
-------

[](#licence)

MIT © Actuate Digital

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ac20c3052eb1a816934cca5c62ed013c024710e0fd9fdd2ac14e45834e980a9?d=identicon)[actuatedigital](/maintainers/actuatedigital)

---

Tags

magentotrackinganalyticsmagento2hyvamagento modulehyva-compatibilitysalesfire

### Embed Badge

![Health badge](/badges/actuatedigital-module-salesfire-hyva/health.svg)

```
[![Health](https://phpackages.com/badges/actuatedigital-module-salesfire-hyva/health.svg)](https://phpackages.com/packages/actuatedigital-module-salesfire-hyva)
```

###  Alternatives

[magewirephp/magewire

A framework that makes building reactive and dynamic interfaces simple in Magento 2

2621.4M45](/packages/magewirephp-magewire)[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8064.7M49](/packages/smile-elasticsuite)[markshust/magento2-module-disabletwofactorauth

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.

2312.9M10](/packages/markshust-magento2-module-disabletwofactorauth)[zumba/amplitude-php

PHP SDK for Amplitude

4110.3M5](/packages/zumba-amplitude-php)[opengento/module-product-breadcrumbs

This module allows to toggle server side rendered breadcrumbs for product pages.

1010.9k](/packages/opengento-module-product-breadcrumbs)

PHPackages © 2026

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