Migrating JavaScript apps to the Orchestration SDK
PingOne Advanced Identity Cloud PingAM JavaScript
The new Orchestration SDK for JavaScript aims to provide a more modern, efficient, and developer-friendly experience than the legacy ForgeRock SDK.
Some of the shifts in methodology are outlined below:
- Async-first initialization
-
Orchestration SDK clients are initialized asynchronously with factory functions, including
journey()andoidc(). - Instance-based APIs
-
Methods are called on client instances, not static classes.
- Modularized packages
-
A significant breakdown into smaller, specialized modules, including clients for Journeys (
@forgerock/journey-client), OIDC (@forgerock/oidc-client), Device management (@forgerock/device-client), and PingOne Protect (@forgerock/protect), and more. - Explicit error handling
-
Response objects contain an
{ error }property, instead of throwing exceptions. - Well-known endpoint discovery
-
Only
serverConfig.wellknownis required. All paths are derived automatically from the response. - Removed the built-in HTTP client
-
Choose how your app makes protected API requests, with manual token retrieval and header management.
- Config is now fixed at creation
-
Per-call config overrides have been removed; you’ll now create separate client instances for different environments or configurations.
Package dependency changes
The modular architecture of the Orchestration SDKs means you only have to import the functionality you require in your apps.
The table below shows the packages available in the new Orchestration SDK for JavaScript:
| ForgeRock SDK | Orchestration SDK | Description |
|---|---|---|
|
|
Navigating authentication journeys. |
|
|
OAuth 2.0 and OIDC token management, user info, and logout. |
|
|
Shared types and enums. |
|
|
Device profiling and management, including OATH, Push, WebAuthn, Binding, and Profiling. |
|
|
PingOne Protect (Signals) integration. |
Code change examples
Initialization and configuration
The legacy ForgeRock SDK uses a global static Config.set(). The new Orchestration SDK for JavaScript uses asynchronous factory functions, each returning an independent client instance.
| ForgeRock SDK | Orchestration SDK | Notes |
|---|---|---|
|
|
Journey client factory. Learn more in Installing the Journey module in JavaScript. |
N/A |
|
OIDC client factory is now a separate package |
|
|
Initialize asynchronously, with config being per-client, not global. Learn more in Configuring the Journey module in JavaScript. |
Authentication and Journeys
| ForgeRock SDK | Orchestration SDK | Notes |
|---|---|---|
|
|
Journey name is now passed per-call by using the Learn more in Starting an authentication journey in JavaScript. |
|
|
No need to repeat the journey config inside Learn more in Navigating an authentication journey in JavaScript |
N/A |
|
Ends the session by using the Learn more in Signing users out. |
Token management and OAuth 2.0 flows
| ForgeRock SDK | Orchestration SDK | Notes |
|---|---|---|
|
|
Now part of oidcClient. Auto-retrieves from storage. Check errors with Learn more in Managing OIDC tokens. |
|
|
Now a single call, with auto-renewal. Returns tokens or an error. Learn more in Managing OIDC tokens. |
|
|
Now uses a two-step process to authorize, when you need explicit control. Learn more in Managing OIDC tokens. |
|
|
Revokes tokens remotely and deletes locally. Learn more in Managing OIDC tokens. |
|
Handled automatically by |
Tokens are now automatically stored after exchange. |
|
|
Now a combined revoke and delete. Learn more in Managing OIDC tokens. |
Migrating using AI assistants
To help you migrate applications from the legacy ForgeRock SDK for JavaScript to the new Orchestration SDK for JavaScript using an AI assistant, we have created a MIGRATION.md file, and an interface_mapping.md file.
These file contain detailed mappings and example snippets of changes between the two SDK versions, which AI assistants can utilize to help you migrate your app.
This approach is designed to reduce manual effort and improve consistency during the migration process.