Skip to content

Commit 537e986

Browse files
mvedma04005claude
andcommitted
Rokt Pay+ mParticle web kit
Re-emits the events an advertiser already logs via the mParticle web SDK as Rokt Pay+ postMessage signals to the embedding plugin, so advertisers get Pay+ signaling without writing postMessage code. Config-driven funnel mapping (progression page views to stepComplete, the conversion custom event to approved). Fires only when embedded in an iframe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 parents  commit 537e986

19 files changed

Lines changed: 14254 additions & 0 deletions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Dependabot Auto Merge
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-test:
7+
name: Run tests
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Git checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Install dependencies, build, then test
14+
run: |
15+
npm install
16+
npm run build
17+
npm run test
18+
19+
automerge:
20+
needs: build-and-test
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: fastify/github-action-merge-dependabot@v1
24+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
25+
with:
26+
github-token: ${{secrets.github_token}}
27+
merge-method: 'squash'

.github/workflows/pull-request.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Web Kit Build & Test
2+
3+
on: pull_request
4+
5+
jobs:
6+
build-and-test:
7+
name: Build and Test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: NPM install
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20.x
17+
18+
- name: Run NPM CI
19+
run: npm ci
20+
21+
- name: Typecheck
22+
run: npm run typecheck
23+
24+
- name: Build Files
25+
run: npm run build
26+
27+
- name: Run Core tests
28+
run: npm run test
29+
30+
- name: Archive npm failure logs
31+
uses: actions/upload-artifact@v4
32+
if: failure()
33+
with:
34+
name: npm-logs
35+
path: ~/.npm/_logs

.github/workflows/release.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Release Kit
2+
3+
# NOTE: The release/publish pipeline runs in mParticle's org once the kit is accepted.
4+
# It depends on mParticle-owned secrets (MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT, NPM_AUTH_TOKEN,
5+
# GPG_PRIVATE_KEY, GPG_PASSPHRASE), the reusable workflow mParticle/mparticle-workflows, and
6+
# publish rights to the @mparticle npm scope. Those do not exist in the ROKT org, so this
7+
# workflow mirrors the target pipeline; it is not expected to run from this repository.
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
dryRun:
13+
description: 'Do a dry run to preview instead of a real release [true/false]'
14+
required: true
15+
default: 'true'
16+
17+
jobs:
18+
confirm-public-repo-main-branch:
19+
name: 'Confirm release is run from public/main branch'
20+
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@stable
21+
22+
build-and-test:
23+
name: Build and Test
24+
runs-on: ubuntu-latest
25+
needs: confirm-public-repo-main-branch
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: NPM install
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 20.x
34+
35+
- name: Run NPM CI
36+
run: npm ci
37+
38+
- name: Build Files
39+
run: npm run build
40+
41+
- name: Run Core tests
42+
run: npm run test
43+
44+
- name: Archive npm failure logs
45+
uses: actions/upload-artifact@v4
46+
if: failure()
47+
with:
48+
name: npm-logs
49+
path: ~/.npm/_logs
50+
51+
create-release-branch:
52+
name: Create release branch
53+
runs-on: ubuntu-latest
54+
needs:
55+
- build-and-test
56+
- confirm-public-repo-main-branch
57+
steps:
58+
- name: Checkout development branch
59+
uses: actions/checkout@v4
60+
with:
61+
repository: ROKT/mparticle-javascript-integration-roktpayplus
62+
ref: development
63+
64+
- name: Create and push release branch
65+
run: |
66+
git checkout -b release/${{ github.run_number }}
67+
git push origin release/${{ github.run_number }}
68+
69+
release:
70+
name: Perform Release
71+
runs-on: ubuntu-latest
72+
needs:
73+
- build-and-test
74+
- create-release-branch
75+
- confirm-public-repo-main-branch
76+
77+
# OIDC permissions for npm trusted publishing
78+
permissions:
79+
contents: write
80+
issues: write
81+
pull-requests: write
82+
id-token: write # Required for OIDC authentication with npm
83+
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
86+
GIT_AUTHOR_NAME: mparticle-automation
87+
GIT_AUTHOR_EMAIL: developers@mparticle.com
88+
GIT_COMMITTER_NAME: mparticle-automation
89+
GIT_COMMITTER_EMAIL: developers@mparticle.com
90+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
91+
92+
steps:
93+
- name: Checkout public main branch
94+
uses: actions/checkout@v4
95+
with:
96+
fetch-depth: 0
97+
ref: main
98+
99+
- name: Import GPG Key
100+
uses: crazy-max/ghaction-import-gpg@v4
101+
with:
102+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
103+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
104+
git_user_signingkey: true
105+
git_commit_gpgsign: true
106+
107+
- name: Merge release branch into main branch
108+
run: |
109+
git pull origin release/${{ github.run_number }}
110+
- name: Setup Node.js
111+
uses: actions/setup-node@v4
112+
with:
113+
node-version: 20.x
114+
115+
- name: Install dependencies
116+
run: npm ci
117+
118+
- name: Release --dry-run
119+
if: ${{ github.event.inputs.dryRun == 'true'}}
120+
run: |
121+
npx semantic-release --dry-run
122+
- name: Release
123+
if: ${{ github.event.inputs.dryRun == 'false'}}
124+
run: |
125+
npx semantic-release
126+
127+
- name: Archive npm failure logs
128+
uses: actions/upload-artifact@v4
129+
if: failure()
130+
with:
131+
name: npm-logs
132+
path: ~/.npm/_logs
133+
134+
- name: Push automated release commits to release branch
135+
if: ${{ github.event.inputs.dryRun == 'false' }}
136+
run: |
137+
git push origin HEAD:release/${{ github.run_number }}
138+
139+
sync-repository:
140+
name: Sync repositories
141+
needs: release
142+
runs-on: ubuntu-latest
143+
steps:
144+
- name: Checkout main branch
145+
uses: actions/checkout@v4
146+
with:
147+
fetch-depth: 0
148+
repository: ${{ github.repository }}
149+
token: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
150+
ref: main
151+
152+
- name: Merge release branch into main branch
153+
if: ${{ github.event.inputs.dryRun == 'false' }}
154+
run: |
155+
git pull origin release/${{ github.run_number }}
156+
157+
- name: Push release commits to main and development branches
158+
if: ${{ github.event.inputs.dryRun == 'false' }}
159+
run: |
160+
git push origin HEAD:development
161+
git push origin HEAD:main
162+
- name: Delete release branch
163+
if: ${{ github.event.inputs.dryRun == 'false' }}
164+
run: |
165+
git push --delete origin release/${{ github.run_number }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Reusable Workflows
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pr-branch-check-name:
8+
name: Check PR for semantic branch name
9+
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-check-name.yml@stable
10+
pr-title-check:
11+
name: Check PR for semantic title
12+
uses: mParticle/mparticle-workflows/.github/workflows/pr-title-check.yml@stable
13+
pr-branch-target-gitflow:
14+
name: Check PR for semantic target branch
15+
uses: mParticle/mparticle-workflows/.github/workflows/pr-branch-target-gitflow.yml@stable
16+
security-lint-checks:
17+
name: Security Lint Checks
18+
uses: mparticle/mparticle-workflows/.github/workflows/security-checks.yml@stable
19+
with:
20+
base_branch: 'development'

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
test/test-bundle.js
3+
test/end-to-end-testapp/compilation.js
4+
5+
dist/*
6+
!dist/.keep
7+
8+
# local-only manual harnesses (contain a client-side key) — never commit
9+
test/manual-e2e.html
10+
test/inspect-event.html

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
node_js:
3+
- "7"
4+
dist: trusty
5+
sudo: required
6+
addons:
7+
chrome: stable
8+
firefox: latest
9+
cache:
10+
directories:
11+
- node_modules
12+
script:
13+
- npm install
14+
- npm run testKarma -- --single-run=true --browsers=ChromeHeadless,FirefoxHeadless

0 commit comments

Comments
 (0)