Skip to content

feat: migrate Rokt Pay Plus kit to monorepo (v1.1.0) - #1302

Open
rmi22186 wants to merge 1 commit into
workstation/3.0-release-3from
feat/roktpayplus-kit-migration
Open

feat: migrate Rokt Pay Plus kit to monorepo (v1.1.0)#1302
rmi22186 wants to merge 1 commit into
workstation/3.0-release-3from
feat/roktpayplus-kit-migration

Conversation

@rmi22186

Copy link
Copy Markdown
Member

Summary

Migrates @mparticle/web-rokt-pay-plus-kit (module ID 184) from its standalone repo into kits/roktpayplus/, matching the TypeScript/Vite/Vitest toolchain established by the Rokt kit migration.

What is Rokt Pay Plus

Rokt Pay+ is a Rokt product that runs inside an iframe on an advertiser's checkout / post-purchase page. This kit is a postMessage bridge: it receives the events the advertiser already logs to mParticle and re-emits them as Pay+ signals (initiated, stepComplete, approved, pending, purchaseCompleted, etc.) to the embedding window. The kit is silent on non-iframed pages — all signals are no-ops when window.parent === window.

Funnel progression is driven by page views; conversions and outcomes are driven by custom events. Everything is configurable via dashboard settings — no Pay+-specific code required in the advertiser's application.

Files

Path Origin
src/RoktPayPlus-Kit.ts Faithful copy from upstream main (v1.1.0)
test/src/RoktPayPlus-Kit.spec.ts Faithful copy from upstream
eslint.config.mjs Faithful copy from upstream
CHANGELOG.md, README.md Faithful copy from upstream
package-lock.json Faithful copy from upstream
package.json Adapted (see below)
vite.config.ts Adapted (see below)
tsconfig.json Adapted (see below)

Monorepo adaptations

package.json

  • @mparticle/web-sdk moved from dependenciespeerDependencies: "^3.0.0" + devDependencies: "^2.73.1" (same pattern as the Rokt kit)
  • Semantic-release devDependencies removed (release is managed at the monorepo level)
  • repository URL updated to point at the monorepo

vite.config.ts

  • rollupOptions.external set to exclude @mparticle/web-sdk from the build output
  • define added for process.env.PACKAGE_VERSION (lockstep version injection)
  • Test alias added:
    • @mparticle/web-sdk/internal../../src/internal-types.ts
    • @mparticle/web-sdk../../dist/mparticle.common.js

tsconfig.json

  • paths added to resolve @mparticle/web-sdk/internal../../src/internal-types.ts for type checking

Test plan

  • npm install && npm run build — builds dist/RoktPayPlus-Kit.{iife,esm,common}.js cleanly
  • npm test — 13/13 Vitest tests pass
  • CI run-kit-tests job passes for kits/roktpayplus

@rmi22186
rmi22186 requested a review from a team as a code owner July 30, 2026 18:25
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive, self-contained kit migration with no changes to core SDK runtime; main risk is misconfigured event mapping affecting Pay+ signals on checkout pages.

Overview
Adds Rokt Pay Plus (kits/roktpayplus/, module ID 184) to the web SDK monorepo and registers it in kits/matrix.json so it can ship with the kit bundle.

The migrated package is the existing postMessage bridge that maps mParticle page views and custom events to Pay+ signals (initiated, stepComplete, approved, gwpApproved, etc.) for an embedded placement. Upstream v1.1.0 behavior is preserved, including dashboard-driven event/screen mapping and the gwpApprovedEventName gift-with-purchase path.

Monorepo wiring follows other TS kits: @mparticle/web-sdk as a peer (external in Vite), path aliases to monorepo SDK types/build for tests and tsc, plus the usual Vite/Vitest/ESLint tooling, README, and CHANGELOG from the standalone repo.

Reviewed by Cursor Bugbot for commit 1d3e3b3. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant