Can Pega work with npm (js+ts) packages?

I have a bundle of js and ts scripts in an npm package. I want to integrate these into Pega 8.5 so I can use exports from said scripts in UI.

Does Pega provide functionality for working with such packages, or is my only option to splice and rewrite the whole module so I can include it as a script in a static content bundle? What’s the best way to integrate this module into Pega?

@NikitaZ2 Pega allows the use of external JavaScript libraries, including npm packages. You can import your JavaScript files under the Scripts & Styles tab in Harness rules or in HTML fragment rules and call the appropriate JS function using events. For TypeScript files, you would need to transpile them to JavaScript before they can be used in Pega. For more detailed steps, you can refer to the documentation on creating custom DX components.

This is a GenAI-powered tool. All generated answers require validation against the provided references.

Importing External React Package into Pega

Specialty Components in PEGA 7.X

Best place to include javascript function?

@NikitaZ2

Ended up minimizing the whole bundle into es5 js with polyfills and adding it as a script.