Skip to content

SDKS-4726: Signals SDK Update & Support Additional Init Options#578

Merged
SteinGabriel merged 1 commit intomainfrom
SDKS-4726
Apr 29, 2026
Merged

SDKS-4726: Signals SDK Update & Support Additional Init Options#578
SteinGabriel merged 1 commit intomainfrom
SDKS-4726

Conversation

@SteinGabriel
Copy link
Copy Markdown
Contributor

@SteinGabriel SteinGabriel commented Apr 22, 2026

Summary

https://pingidentity.atlassian.net/browse/SDKS-4726

Implements support for the new signalsInitializationOptions output property on PingOneProtectInitializeCallback, allowing AM to pass arbitrary key-value config directly to the Signals SDK at initialization.

Also updates the Signals SDK from v5.6.0w → v5.6.9w.

Changes

packages/journey-client

  • PingOneProtectInitializeCallback#getConfig() now detects signalsInitializationOptions in the callback output
    • If it's a valid plain object → returned directly as SignalsInitializationOptions
    • Otherwise (absent, null, string, array) → falls back to existing ProtectConfig field-by-field construction
  • Return type widened to ProtectConfig | SignalsInitializationOptions

packages/protect

  • protect() now accepts ProtectConfig | SignalsInitializationOptions
  • behavioralDataCollection guard handles both true (boolean) and 'true' (string)
  • New SignalsInitializationOptions type exported from protect.types.ts
  • Vendored Signals SDK updated to v5.6.9w

Tests

  • 3-path callback tests: valid object (direct return), missing property (fallback), invalid value (fallback)
  • Updated protect.test.ts to cover Record<string, unknown> pass-through config

How to test

1. Configure the AM Journey node

In the PingOne Protect Initialize node of your AM journey, scroll to Additional Signals SDK Initialization Options and add one or more key-value pairs:

  1. Click the + icon next to "Additional Signals SDK Initialization Options".
  2. In the dialog that opens, click + Add.
  3. Enter a key (e.g. waitForWindowLoad) and a value (e.g. true).
  4. Click Save.

Keys must not duplicate properties already configured by the node's existing fields (e.g. behavioralDataCollection, disableTags).
Valid signal keys are listed in the [Signals SDK integration docs](https://docs.pingidentity.com/sdks/latest/sdks/integrations/pingone-protect/03-app.html#start).

2. Run the journey with the SDK

You can use a sample app that exercises PingOneProtectInitializeCallback (e.g. reactjs-todo-journey in sdk-sample-apps):

Important: To test it locally, the local SDK build has to be used on the sample app.

  • When the journey hits the PingOne Protect Initialize node, getConfig() should return the extra options object directly (e.g. { waitForWindowLoad: "true" }).
  • protect(config) receives that object and passes it straight to _pingOneSignals.init(config).
  • Verify in the browser's network/console that the Signals SDK initializes with the additional options.

3. Verify the fallback path still works

Remove all entries from Additional Signals SDK Initialization Options (leave it empty) and re-run the journey — the SDK should initialize using the individual node fields (behavioralDataCollection, etc.) as before.

Screenshot for reference

image

Summary by CodeRabbit

  • New Features

    • Added pass-through support for Signals initialization options from AM so returned init options can be supplied directly to the Signals SDK.
    • Behavioral-data resumption now recognizes the string "true" as enabling resumption.
  • Tests

    • Expanded tests to cover pass-through init options and behavioral-data resumption behaviors.
  • Chores

    • Updated vendored Signals SDK to v5.6.9w.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@SteinGabriel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 22 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7c8c089-5ae6-4f43-802a-c871abd549ad

📥 Commits

Reviewing files that changed from the base of the PR and between 407da51 and 096733d.

📒 Files selected for processing (9)
  • .changeset/sdks-4726-signals-init-options.md
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts
  • packages/protect/src/lib/protect.test.ts
  • packages/protect/src/lib/protect.ts
  • packages/protect/src/lib/protect.types.ts
  • packages/protect/src/lib/signals-sdk.js
📝 Walkthrough

Walkthrough

Adds pass-through support for signalsInitializationOptions from AM: getConfig() returns the raw signalsInitializationOptions when it's a plain object; otherwise it builds the existing ProtectConfig. protect() now accepts ProtectConfig | SignalsInitializationOptions and resumes behavioral data when behavioralDataCollection is boolean true or the string "true".

Changes

Cohort / File(s) Summary
Changeset documentation
\.changeset/sdks-4726-signals-init-options.md
New changeset describing patch releases for @forgerock/journey-client and @forgerock/protect, and a vendored Signals SDK update (v5.6.0wv5.6.9w).
Journey Client API reports
packages/journey-client/api-report/journey-client.api.md, packages/journey-client/api-report/journey-client.types.api.md
PingOneProtectInitializeCallback.getConfig() return type changed to `Record<string, unknown>
Journey Client implementation & tests
packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts, packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts
getConfig() now returns signalsInitializationOptions verbatim when present as a non-null plain object; otherwise it constructs the legacy ProtectConfig. Tests added for valid pass-through and invalid/missing cases; copyright year updated.
Protect types
packages/protect/src/lib/protect.types.ts
Added exported type SignalsInitializationOptions = Record<string, string> documenting arbitrary key/value initialization options returned by AM.
Protect implementation & tests
packages/protect/src/lib/protect.ts, packages/protect/src/lib/protect.test.ts
protect() parameter type widened to `ProtectConfig

Sequence Diagram(s)

sequenceDiagram
  participant AM as "AM (server)"
  participant JC as "Journey Client\nPingOneProtectInitializeCallback"
  participant App as "App / protect()"
  participant Signals as "window._pingOneSignals\n(Signals SDK)"

  AM->>JC: callback output (may include\n`signalsInitializationOptions`)
  JC->>JC: getConfig() checks output
  alt signalsInitializationOptions is plain object
    JC-->>App: returns SignalsInitializationOptions (pass-through)
  else missing/invalid
    JC-->>App: returns constructed ProtectConfig
  end
  App->>Signals: window._pingOneSignals.init(options)
  alt options.behavioralDataCollection === true or "true"
    App->>Signals: window._pingOneSignals.resumeBehavioralData()
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • ancheetah
  • ryanbas21

Poem

🐰 I nibbled configs, hopped through the night,
Pass-through options now travel just right,
From AM to Signals, no more type fights,
Init called cleanly — what a delight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: Signals SDK version update and support for additional initialization options pass-through.
Description check ✅ Passed The pull request description includes the JIRA ticket link and comprehensive detail of all changes, implementation strategy, tests, and testing instructions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4726

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 47 minutes and 22 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: 096733d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@forgerock/journey-client Patch
@forgerock/protect Patch
@forgerock/davinci-client Patch
@forgerock/device-client Patch
@forgerock/oidc-client Patch
@forgerock/sdk-types Patch
@forgerock/sdk-utilities Patch
@forgerock/iframe-manager Patch
@forgerock/sdk-logger Patch
@forgerock/sdk-oidc Patch
@forgerock/sdk-request-middleware Patch
@forgerock/storage Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Apr 22, 2026

View your CI Pipeline Execution ↗ for commit 407da51

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 1m 49s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-29 17:56:48 UTC

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

Our analysis found that the @forgerock/api-report:test failures are caused by integration tests narrowly exceeding their 5000ms timeout (actual: 5.3–6.7s), not by any code introduced in this PR. Since @forgerock/api-report was not modified by these changes and no similar failures exist on other branches, this appears to be a transient CI environment performance issue.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Copy link
Copy Markdown
Contributor

@vatsalparikh vatsalparikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good, just need to fix the failing CI pipeline!

Tested additional options with a ping protect specific journey defined in tenant. I can see the additional property in console!

Copy link
Copy Markdown
Collaborator

@cerebrl cerebrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. Can we just get a confirmation on the value data type for the config?

* @type SignalsInitializationOptions - Arbitrary key-value map passed directly to the Signals SDK initialization.
* Used when AM returns a `signalsInitializationOptions` output on the `PingOneProtectInitializeCallback`.
*/
export type SignalsInitializationOptions = Record<string, unknown>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can narrow this down to just Record<string, string>. I'd like to ask @witrisna if the value is limited to just a string. Can you confirm this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed in this Slack thread that Signals SDK values are string-only.
Narrowed SignalsInitializationOptions to Record<string, string>. Also updated the getOutputByName generic in the callback to match.
By the way, this is Record<string, unknown> in the legacy SDK. It's probably fine, just wanted to flag it in case we need to update the legacy version too.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@578

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@578

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@578

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@578

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@578

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@578

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@578

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@578

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@578

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@578

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@578

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@578

commit: 096733d

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.51%. Comparing base (5d6747a) to head (096733d).
⚠️ Report is 81 commits behind head on main.

❌ Your project status has failed because the head coverage (17.51%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #578       +/-   ##
===========================================
- Coverage   70.90%   17.51%   -53.40%     
===========================================
  Files          53      154      +101     
  Lines        2021    24151    +22130     
  Branches      377     1146      +769     
===========================================
+ Hits         1433     4229     +2796     
- Misses        588    19922    +19334     
Files with missing lines Coverage Δ
.../lib/callbacks/ping-protect-initialize-callback.ts 100.00% <100.00%> (ø)
packages/protect/src/lib/protect.ts 64.40% <100.00%> (ø)
packages/protect/src/lib/protect.types.ts 100.00% <ø> (ø)
packages/protect/src/lib/signals-sdk.js 0.00% <ø> (ø)

... and 98 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Deployed fdab94c to https://ForgeRock.github.io/ping-javascript-sdk/pr-578/fdab94cf4c99d60d8381a010179fdedb3d43c05c branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/protect - 144.6 KB (-5.4 KB, -3.6%)
🔻 @forgerock/journey-client - 0.0 KB (-90.2 KB, -100.0%)

📊 Minor Changes

📈 @forgerock/journey-client - 90.3 KB (+0.1 KB)

➖ No Changes

@forgerock/device-client - 10.0 KB
@forgerock/davinci-client - 48.3 KB
@forgerock/oidc-client - 25.2 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/storage - 1.5 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/iframe-manager - 2.4 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/journey-client/api-report/journey-client.api.md (1)

321-332: ⚠️ Potential issue | 🟠 Major

Narrow the getConfig() return type from Record<string, unknown> to Record<string, string>.

The getConfig() method exposes Record<string, unknown>, while SignalsInitializationOptions in packages/protect/src/lib/protect.types.ts (line 14) is strictly Record<string, string>. This type mismatch weakens interoperability for the "getConfig() → protect(config)" path and forces consumer-side casts when passing the config between these APIs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/journey-client/api-report/journey-client.api.md` around lines 321 -
332, The public signature for getConfig() currently allows Record<string,
unknown>, which conflicts with SignalsInitializationOptions (Record<string,
string>); change the generic index signature in the getConfig() return type from
Record<string, unknown> to Record<string, string> so callers can pass
getConfig() results directly to protect(config). Update the declaration that
reads getConfig(): Record<string, unknown> | { ... } to use Record<string,
string> | { ... } (keep the explicit envId/consoleLogEnabled/etc. object shape
as-is) and ensure exported type annotations match SignalsInitializationOptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/journey-client/api-report/journey-client.api.md`:
- Around line 321-332: The public signature for getConfig() currently allows
Record<string, unknown>, which conflicts with SignalsInitializationOptions
(Record<string, string>); change the generic index signature in the getConfig()
return type from Record<string, unknown> to Record<string, string> so callers
can pass getConfig() results directly to protect(config). Update the declaration
that reads getConfig(): Record<string, unknown> | { ... } to use Record<string,
string> | { ... } (keep the explicit envId/consoleLogEnabled/etc. object shape
as-is) and ensure exported type annotations match SignalsInitializationOptions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d3a8784-2d12-4f3d-9d75-d8c913401748

📥 Commits

Reviewing files that changed from the base of the PR and between bd97d16 and 407da51.

📒 Files selected for processing (9)
  • .changeset/sdks-4726-signals-init-options.md
  • packages/journey-client/api-report/journey-client.api.md
  • packages/journey-client/api-report/journey-client.types.api.md
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts
  • packages/protect/src/lib/protect.test.ts
  • packages/protect/src/lib/protect.ts
  • packages/protect/src/lib/protect.types.ts
  • packages/protect/src/lib/signals-sdk.js
✅ Files skipped from review due to trivial changes (1)
  • .changeset/sdks-4726-signals-init-options.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/protect/src/lib/protect.types.ts
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts
  • packages/protect/src/lib/protect.test.ts
  • packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts

chore(protect): update signals-sdk to v5.6.9w

chore(protect): fix JSDoc param type and update copyright year to 2026

chore(changeset): add changeset for SDKS-4726 signalsInitializationOptions support

fix(protect): narrow SignalsInitializationOptions to Record<string, string>

docs: update api report documentation
@SteinGabriel SteinGabriel merged commit c82e795 into main Apr 29, 2026
8 checks passed
@SteinGabriel SteinGabriel deleted the SDKS-4726 branch April 29, 2026 17:58
@ryanbas21 ryanbas21 mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants