Skip to content

Conversation

@tnt-glenn-mccomb
Copy link

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

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.

1 participant