Pega DX Custom Component Build Notes
Handwritten steps converted into a quick implementation guide for video follow-along.
Prerequisites
- Node.js: Ensure Node.js is downloaded & installed on your machine.[cite: 1]
- OAuth 2.0 Client: In Pega, create an OAuth 2.0 Client Registration rule, then download both the Client ID and Client Secret.[cite: 1]
- Refer to official Pega Documentation to see how to initialize the DX component project.[cite: 1]
Initialize the Project
Run the initialization command in your terminal:[cite: 1]
npx @pega/custom-dx-component@~26.1 init
- Go to your Pega Infinity App and create a dedicated Ruleset (e.g.,
MyDXComp:01-01).[cite: 1] - Inside your Application Definition, add this newly created Ruleset.[cite: 1]
- When prompted by the CLI, provide:[cite: 1]
- Project Name:
My first component(creates local folder)[cite: 1] - Organization Name:
My org[cite: 1] - Description: (Enter custom description)[cite: 1]
- Project Name:
Configure tasks.config.json
Open the generated tasks.config.json file and update the following connection properties:[cite: 1]
Client Credentials[cite: 1]
Create the Component
npm run create
- Component Type: Select 3) Widget[cite: 1]
- Subtype: Select 3) Page & Case[cite: 1]
- Component Name / Label / Description: Enter
Timer[cite: 1]
Note: This scaffolds the skeleton. Open the workspace in VS Code under My first component/src/components/My first comp/Timer to begin your implementation.[cite: 1]
Package into a Library
(This step is required)[cite: 1]
cd "My first component"
npm run createLib
- Library Name:
MFC[cite: 1] - Version #:
0.0.1[cite: 1]
Authenticate the library against your target instance:[cite: 1]
npm run authenticate
Enter your target Pega Server URL when prompted.[cite: 1]
Storybook, Coding & Publishing
- Write your custom logic inside
index.tsx.[cite: 1] - Use
Stories.tsxto demo and inspect your component.[cite: 1]
npm run startStorybook
Once everything looks good, push it to your Pega application:[cite: 1]
npm run publish
Final Step in UI: Open App Studio → Navigate to Library / DX Component → Add to Application. All set![cite: 1]
⚡ Quick Command Reference
Official Pega Academy Mission
Complete the Constellation DX Components training mission on Pega Academy.
