⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@tnt-glenn-mccomb
Copy link
Contributor

JIRA Ticket

N/A

Description

While working on a component to handle Ping One Protect using @forgerock/javascript-sdk, I found that after updating to the latest version of @forgerock/ping-protect (eg. 4.6.2) I starting to see unexpected TypeScript errors when I attempted to pull Ping One config from a PingOneProtectInitializeCallback callback via PingOneProtectInitializeCallback.getConfig(). This is expected to return an object with the following type:

declare class PingOneProtectInitializeCallback extends FRCallback {
    payload: Callback;
    /**
     * @param payload The raw payload returned by OpenAM
     */
    constructor(payload: Callback);
    /**
     * Get callback's initialization config settings
     */
    getConfig(): {
        behavioralDataCollection: boolean;
        disableTags: boolean;
        universalDeviceIdentification: boolean;
        consoleLogEnabled: boolean;
        deviceAttributesToIgnore: string[];
        customHost: string;
        lazyMetadata: boolean;
        deviceKeyRsyncIntervals: number;
        enableTrust: boolean;
        disableHub: boolean;
        agentPort?: number | undefined;
        agentTimeout?: number | undefined;
        agentIdentification?: boolean | undefined;
        envId: string;
    };
    setClientError(errorMessage: string): void;
}

This works fine in version 4.6.1 of @forgerock/ping-protect, however in 4.6.2 when I attempt to pass the result of PingOneProtectInitializeCallback.getConfig() to PIProtect.start(config) I get a TypeScript error because PIProtect.start() is expecting the _type and _action fields. These fields are explicitly omitted in the InitConfig interface in packages/ping-protect/src/lib/ping-protect.ts.

// Example code
const config = pingOneProtectInitializeCallback.getConfig();
await PIProtect.start(config);

Here's a screenshot of the TypeScript error from VS Code.

ping-one-protect-start

Full error in plain text:

Argument of type '{ behavioralDataCollection: boolean; disableTags: boolean; universalDeviceIdentification: boolean; consoleLogEnabled: boolean; deviceAttributesToIgnore: string[]; customHost: string; ... 7 more ...; envId: string; }' is not assignable to parameter of type 'ProtectInitializeConfig'.
  Type '{ behavioralDataCollection: boolean; disableTags: boolean; universalDeviceIdentification: boolean; consoleLogEnabled: boolean; deviceAttributesToIgnore: string[]; customHost: string; ... 7 more ...; envId: string; }' is missing the following properties from type 'ProtectInitializeConfig': _type, _action 
ts(2345)

Did you add a changeset?

Yes a changeset has been included. I'm not sure if this is appropriate for a change like this (developer facing).

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 82bd6e3

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

This PR includes changesets to release 1 package
Name Type
@forgerock/ping-protect 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

@ryanbas21
Copy link
Contributor

@tnt-glenn-mccomb thank you for the contribution. We had an error in our fork ci flow that is causing this to fail. I rebased your PR and re-opened it and it worked. You can feel free to rebase this, or we can just move forward with the PR that I created (your commits are still there).

I'll get someone to review it for me as well. This looks good though.

@ryanbas21
Copy link
Contributor

Closed and merged with your commits in #575

@ryanbas21 ryanbas21 closed this Jan 26, 2026
@tnt-glenn-mccomb
Copy link
Contributor Author

Awesome thank you @ryanbas21 sounds like a good solution.

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.

2 participants