@pega/sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
# Skill: Wire Pega Integration
|
|
2
|
+
|
|
3
|
+
Guide the wiring of generated Pega components into a customer's existing application so that a Pega case flow renders seamlessly within their UI.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
After the `pega-components/` folder has been generated (via the component generation prompt), this skill describes the steps to integrate the Pega SDK into the customer's application — connecting authentication, bootstrapping the runtime, launching case flows on user action, and rendering the flow within the application's layout.
|
|
10
|
+
|
|
11
|
+
**Step 0 is the exception.** It is a gate, not an integration step, and it runs _before_ generation — see its own heading for why.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
- The `pega-components/` folder exists with generated components and a registry file named `component-map` (the extension follows the customer's framework) — required from **Step 1 onward**. Step 0 runs before generation and needs only the customer's codebase and the Design Profile
|
|
18
|
+
- The customer has a Pega Infinity environment with:
|
|
19
|
+
- An OAuth 2.0 client configured for the application
|
|
20
|
+
- A case type to embed (e.g., a service request, onboarding flow)
|
|
21
|
+
- The SDK configuration values (server URL, app alias, client ID)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Never handle credentials
|
|
26
|
+
|
|
27
|
+
Operator credentials are typed by a human, into a visible login form, and never touched by this skill. Do not request them, capture them, echo them, write them to any file, or include them in diagnostic output — at any step, and under any failure condition.
|
|
28
|
+
|
|
29
|
+
This is stated here because it is broken during **debugging**, not during wiring. When a step fails and the temptation is to print the values being sent so the cause is visible, that is the moment the rule applies. Log the shape of what was sent, never the contents. Client secrets and access tokens are covered by the same rule; the configuration file holds only what is safe to serve to a browser.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Integration Steps
|
|
34
|
+
|
|
35
|
+
### Step 0 — Confirm the launch point and render target
|
|
36
|
+
|
|
37
|
+
⛔ **Run this immediately after codebase analysis and before component generation** — not at wiring time, where it sits in this document's numbering.
|
|
38
|
+
|
|
39
|
+
It sits after analysis because resolving the render target may require asking the user, and the options must be drawn from surfaces the application already has — which is what the Design Profile records. It sits before generation because it is the only step that can cancel the integration, and generation writes a folder of components. Analysis is safe to run first regardless: it adds a single profile file and changes nothing the customer owns.
|
|
40
|
+
|
|
41
|
+
Two things must be settled before a single file changes: **what launches the flow**, and **where the flow renders**. Neither may be assumed, and neither may be deferred until the step that needs it.
|
|
42
|
+
|
|
43
|
+
#### Step 0.1 — Resolve the launch point
|
|
44
|
+
|
|
45
|
+
The user names the trigger in their own words — "on click of the apply loan button", "when someone submits the contact form", "from the Get started link". Resolve that description to a real control in their code before touching anything.
|
|
46
|
+
|
|
47
|
+
Locate the named control by its visible label, then read the surrounding code and determine whether it already has behaviour attached. Look for:
|
|
48
|
+
|
|
49
|
+
- an event handler bound to the named event
|
|
50
|
+
- navigation of any kind — a link, a route change, a redirect
|
|
51
|
+
- form submission or a server action
|
|
52
|
+
- a state change that opens the customer's own dialog, drawer, or step
|
|
53
|
+
- side effects such as analytics or logging on that same event
|
|
54
|
+
|
|
55
|
+
**A control that "only navigates" still counts as existing behaviour.** The most common collision is exactly this: an _Apply_ or _Get started_ control that already routes to the customer's own application form. Embedding a Pega case there replaces the customer's whole flow, which is precisely the decision they must make consciously.
|
|
56
|
+
|
|
57
|
+
**If the user named no launch point at all** — a request like "embed this case in my application" states the goal and nothing else — go to Step 0.3 and ask. This is not a detail to be filled in later.
|
|
58
|
+
|
|
59
|
+
**If the control cannot be found**, report what you searched for and ask the user to identify it. Do not invent a new control, and do not substitute a similar-looking one.
|
|
60
|
+
|
|
61
|
+
**If the control exists and already has behaviour**, stop and ask the user, naming the file, the control, and what it currently does:
|
|
62
|
+
|
|
63
|
+
> The _[label]_ control in _[file]_ currently _[does X]_. Embedding the Pega case flow on this trigger replaces that behaviour. Do you want to override it?
|
|
64
|
+
|
|
65
|
+
| Answer | Action |
|
|
66
|
+
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| Override | Continue to Step 0.2. Record in the final summary exactly what was replaced so the user can restore it from version control |
|
|
68
|
+
| Do not override | **Stop the entire wiring process.** Do not embed the flow, do not wire a different control, and do not leave partial edits behind. Report what was left untouched and tell the user the flow can be re-run once they nominate a trigger to use |
|
|
69
|
+
|
|
70
|
+
**If the control exists and has no behaviour**, continue to Step 0.2.
|
|
71
|
+
|
|
72
|
+
Never infer consent. An unanswered question is not an override.
|
|
73
|
+
|
|
74
|
+
#### Step 0.2 — Resolve the render target
|
|
75
|
+
|
|
76
|
+
The render target is the surface the case flow appears on — a dialog, a route, or a region of an existing page. It determines what Step 5 mounts into and how Step 6 tears down, so it is settled here rather than improvised there.
|
|
77
|
+
|
|
78
|
+
Work through these in order and stop at the first that produces an answer.
|
|
79
|
+
|
|
80
|
+
**1. The user stated it.** Read the request thoroughly before concluding they did not. "On click of apply loan _inside a modal_", "... _in a new page_", "... in the panel on the right" all state a target. When it is stated, use it — do not substitute a different surface because it looks easier to wire.
|
|
81
|
+
|
|
82
|
+
**2. The control's existing behaviour states it.** When Step 0.1 found behaviour and the user approved the override, that behaviour is the answer. The customer has already decided how this journey presents itself, and the embedded flow inherits it:
|
|
83
|
+
|
|
84
|
+
| What the control does today | Where the Pega flow renders |
|
|
85
|
+
| ------------------------------------ | ------------------------------------------------------------------------- |
|
|
86
|
+
| Opens a dialog, drawer or sheet | The same kind of surface, built from the same primitive |
|
|
87
|
+
| Navigates to a route or page | **That same route.** The Pega flow replaces what the destination rendered |
|
|
88
|
+
| Reveals a region of the current page | That same region |
|
|
89
|
+
|
|
90
|
+
Taking over the route rather than adding a sibling one is deliberate: existing links and bookmarks keep working, and no unreachable page is left behind.
|
|
91
|
+
|
|
92
|
+
**3. Otherwise, ask.** Reached when the control has no existing behaviour to inherit, or when no launch point was named at all. Go to Step 0.3.
|
|
93
|
+
|
|
94
|
+
#### Step 0.3 — Ask, in the customer's own vocabulary
|
|
95
|
+
|
|
96
|
+
A generic list of surfaces is not good enough. Draw the options from the application itself — the Design Profile records its overlay primitives, its routing approach, and its existing entry-point flows — and name real surfaces from their codebase so the choice is concrete:
|
|
97
|
+
|
|
98
|
+
> Your application opens the _New request_ form in a dialog, and gives the loan journey its own full page. Where should the Pega case flow appear?
|
|
99
|
+
>
|
|
100
|
+
> - In a dialog, the way _New request_ does
|
|
101
|
+
> - As a full page at its own route, the way the loan journey does
|
|
102
|
+
> - Inline within a page you already have — tell me which one
|
|
103
|
+
>
|
|
104
|
+
> And what should open it? Name the control, and I will check whether it already does something first.
|
|
105
|
+
|
|
106
|
+
**If the Design Profile has not been produced yet**, do not fall back to a generic list. Inspect the application directly for the same three things — how it routes, which overlay primitive it uses, and how its existing entry points open — and build the options from what you find.
|
|
107
|
+
|
|
108
|
+
Ask for both in a single exchange when both are missing. Two round trips for one decision is worse than one.
|
|
109
|
+
|
|
110
|
+
#### Step 0.4 — The resolved target must survive a full-page reload
|
|
111
|
+
|
|
112
|
+
Whichever target Step 0.2 or Step 0.3 produced, it has to survive being reloaded. The SDK authenticates by redirecting the whole window to the Pega login form and back, so the application is torn down and re-created between the moment the user triggers the flow and the moment the flow can render. Anything holding the launch context only in memory is gone by then.
|
|
113
|
+
|
|
114
|
+
This is a property of the target, not an edge case, and it must be handled while wiring rather than discovered later:
|
|
115
|
+
|
|
116
|
+
| Resolved target | What is lost, and what must be restored |
|
|
117
|
+
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
118
|
+
| A dialog, drawer, sheet, or any overlay | Its open state is a value in memory that the reload discards. Persist the intent to launch before the redirect, and re-open the overlay on return before mounting |
|
|
119
|
+
| A route that is not at the site root | The return lands on the address registered with the identity provider, which resolves to the site root — not to where the user was. Persist the launch location before the redirect, and navigate back to it on return |
|
|
120
|
+
| A route at the site root | Nothing. The return already lands there |
|
|
121
|
+
|
|
122
|
+
Use the application's own mechanisms for both halves — whatever it already uses to keep state across a reload, and whatever it already uses to navigate. Persist only what is needed to re-establish the launch context; never persist anything the user typed and never persist anything returned by authentication.
|
|
123
|
+
|
|
124
|
+
**This only bites the first time a user authenticates.** Once a session exists the redirect does not happen, the application is never torn down, and the flow appears correctly — so an unhandled target looks intermittent rather than broken, and reliably survives testing. Treat it as always present.
|
|
125
|
+
|
|
126
|
+
#### Step 0.5 — The runtime outlives the target; the launch does not
|
|
127
|
+
|
|
128
|
+
Bootstrap initialises runtime globals that belong to the **page**, not to the target surface. They can be initialised once and only once. Creating a case is the opposite — it happens once per launch, every time the user asks for the flow.
|
|
129
|
+
|
|
130
|
+
These two lifetimes are easy to collapse into one, because on a first launch they look identical: reveal the target, bootstrap, create a case, render. The mistake is binding the runtime's lifetime to the target's visibility, so that hiding the target discards the runtime:
|
|
131
|
+
|
|
132
|
+
| Concern | Lifetime | What goes wrong if bound to the target |
|
|
133
|
+
| ----------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
134
|
+
| Runtime bootstrap | Once, for as long as the page lives | The second launch re-initialises an already-initialised runtime. It stalls before issuing any request, and the loading state never clears |
|
|
135
|
+
| Case creation | Once per launch | A launch that only fires when the flow is first set up never fires again, so a later launch reveals an empty target |
|
|
136
|
+
|
|
137
|
+
So:
|
|
138
|
+
|
|
139
|
+
- **Keep the runtime for the lifetime of the page.** When the target is dismissed, hide it and leave the runtime in place. Never discard it to close the flow.
|
|
140
|
+
- **Do not establish it at page start either**, if doing so would authenticate. The first launch is what puts a visitor in front of the login form, and nothing should send them there before they ask. Establish it on the first launch, then keep it.
|
|
141
|
+
- **Drive case creation from the launch itself**, not from the runtime being set up, so that every launch creates a case and the second one behaves like the first.
|
|
142
|
+
|
|
143
|
+
**A single launch cannot detect any of this.** Set-up and first launch coincide, so the flow works, and the defect appears only on a second launch — which is why Step 7 requires the flow to be launched more than once.
|
|
144
|
+
|
|
145
|
+
⛔ **This is a gate.** Do not continue to Step 1 without a resolved launch point and a resolved render target. Do not pick one because the user did not answer — an unanswered question is not a choice. Carry all of it forward: Step 4 attaches the launch to the resolved control, Step 5 mounts into the resolved target, and both honour the reload and lifetime obligations above.
|
|
146
|
+
|
|
147
|
+
### Step 1 — Install SDK dependencies
|
|
148
|
+
|
|
149
|
+
Add the following Pega packages to the project's dependency manifest:
|
|
150
|
+
|
|
151
|
+
| Package | Purpose |
|
|
152
|
+
| ---------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
153
|
+
| The Pega SDK adapter package (matching the customer's framework) | Bridge component, runtime context, component registry utilities |
|
|
154
|
+
| The Pega auth package | OAuth authentication and token management |
|
|
155
|
+
| The Pega SDK types package | Shared type definitions and interfaces |
|
|
156
|
+
| The Pega ConstellationJS core package | Runtime engine that provides the PCore global |
|
|
157
|
+
|
|
158
|
+
These are the only external additions. The generated `pega-components/` use the customer's existing UI library — no additional design system packages are needed.
|
|
159
|
+
|
|
160
|
+
If SDK packages were provided as `.tgz` files (interim distribution), they should already be in the project root with `file:` references in the dependency manifest. Run the project's package install command to link them.
|
|
161
|
+
|
|
162
|
+
### Step 1.1 — Load the SDK core runtime script
|
|
163
|
+
|
|
164
|
+
The Pega ConstellationJS core must be loaded **before** any SDK code executes. It provides the `PCore` global object that all Pega components depend on.
|
|
165
|
+
|
|
166
|
+
The script ships inside the ConstellationJS package, under its distribution directory. Resolve the exact path from the installed package rather than copying the file anywhere.
|
|
167
|
+
|
|
168
|
+
**Where it goes depends on the shape of the project's entry point.** Identify which of these the customer's framework is, then apply it:
|
|
169
|
+
|
|
170
|
+
| Entry-point shape | How to load the core script |
|
|
171
|
+
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
172
|
+
| The project has a hand-editable HTML document that loads the application module | Add a script element ahead of the application's own module script, so it executes first |
|
|
173
|
+
| The framework generates the HTML document and exposes a root layout or shell | Use the framework's mechanism for injecting a script that runs before application code — most provide an explicit "before interactive" or "head" placement for exactly this |
|
|
174
|
+
| The framework renders on the server | The script must execute in the browser only. Use the framework's browser-only escape hatch; never let it run during a server render, where there is no `window` to attach `PCore` to |
|
|
175
|
+
|
|
176
|
+
If the development server does not serve files from the dependency directory, either configure it to, or place a copy where the project already serves static assets and reference it from there. Prefer serving from the installed package when the toolchain allows it — a copy silently goes stale when the package is upgraded.
|
|
177
|
+
|
|
178
|
+
**Key requirements:**
|
|
179
|
+
|
|
180
|
+
- The core script must load and execute **before** the application module runs
|
|
181
|
+
- It must execute only in the browser, not during any server-side rendering phase
|
|
182
|
+
- The reference must resolve from the route the flow launches at — see the document-relative discussion in Step 2, which applies to this script too
|
|
183
|
+
|
|
184
|
+
**Verification criterion:** The browser's network panel shows the core script loaded successfully, and the `PCore` global object is available on `window` before application code executes.
|
|
185
|
+
|
|
186
|
+
### Step 1.2 — Load SDK styles and OAuth callback assets
|
|
187
|
+
|
|
188
|
+
**SDK adapter stylesheet:**
|
|
189
|
+
|
|
190
|
+
The SDK adapter package exports a stylesheet that provides styling for the infrastructure components the SDK itself renders (navigation bars, deferred loaders, vertical tabs, and dashboard filters). Without this stylesheet, these components render with class names but no matching CSS rules — resulting in unstyled or invisible controls.
|
|
191
|
+
|
|
192
|
+
The three overridable chrome components — action buttons, stage indicators, and multi-step navigation — are exempt **when they have been generated and registered as overrides**, because they then carry the customer's own styling. Import the stylesheet regardless: the SDK still renders the non-overridable components, and it costs nothing when an override is in place.
|
|
193
|
+
|
|
194
|
+
Import this stylesheet in the application's entry point, **before** the application's own global styles. Resolve the exact import specifier from the adapter package's `exports` map in its `package.json` (the CSS export path).
|
|
195
|
+
|
|
196
|
+
**Verification criterion:** After importing, the browser's network panel shows the stylesheet loaded. Infrastructure components rendered by the SDK display visible, styled controls (navigation is positioned, deferred loaders show progress).
|
|
197
|
+
|
|
198
|
+
**OAuth callback assets:**
|
|
199
|
+
|
|
200
|
+
The SDK's auth package ships browser-facing assets used during the OAuth redirect flow:
|
|
201
|
+
|
|
202
|
+
| Asset | Source (in auth package) | Required served location |
|
|
203
|
+
| ----------------------- | ---------------------------------------- | --------------------------------------------------------------- |
|
|
204
|
+
| OAuth callback document | `lib/oauth-client/authDone.html` | Served as `auth.html` at the application's web root |
|
|
205
|
+
| Callback script | `lib/oauth-client/authDone.js` | Served as `authDone.js` at the application's web root |
|
|
206
|
+
| Lock icon | `lib/oauth-client/lock-closed-solid.svg` | Served as `lock-closed-solid.svg` at the application's web root |
|
|
207
|
+
|
|
208
|
+
These files must be placed in the served-static directory identified in Step 2. The callback document must be renamed to `auth.html`; the other files keep their original names.
|
|
209
|
+
|
|
210
|
+
**Verification criterion:** Navigating to `<origin>/auth.html` in the browser displays the OAuth callback page (a brief "Authorization complete" message).
|
|
211
|
+
|
|
212
|
+
### Step 2 — Add SDK configuration
|
|
213
|
+
|
|
214
|
+
The SDK configuration file (`sdk-config.json`) provides connection and authentication details for the Pega server. The SDK's auth client fetches this file at runtime via a **document-relative** URL (`./sdk-config.json`).
|
|
215
|
+
|
|
216
|
+
**⚠️ CRITICAL — Document-relative fetch implications:**
|
|
217
|
+
|
|
218
|
+
Because the fetch uses a relative URL, resolution depends on the route depth at which bootstrap runs:
|
|
219
|
+
|
|
220
|
+
| Route when bootstrap executes | Resolved URL | Result |
|
|
221
|
+
| ----------------------------- | ------------------------ | ------ |
|
|
222
|
+
| `/` | `/sdk-config.json` | ✅ |
|
|
223
|
+
| `/apply` | `/sdk-config.json` | ✅ |
|
|
224
|
+
| `/apply/` (trailing slash) | `/apply/sdk-config.json` | ❌ 404 |
|
|
225
|
+
| `/loans/apply` | `/loans/sdk-config.json` | ❌ 404 |
|
|
226
|
+
|
|
227
|
+
If the case flow can launch from a nested route or a route with a trailing slash, set an explicit document base URL (e.g., `<base href="/">` or the framework's equivalent base-path configuration) so that the relative fetch always resolves against the application root.
|
|
228
|
+
|
|
229
|
+
**Placement — discovery procedure:**
|
|
230
|
+
|
|
231
|
+
1. Identify the directory the project serves at its web root — locate it by finding where other served static assets (images, icons, manifests) reside
|
|
232
|
+
2. Place `sdk-config.json` in that directory
|
|
233
|
+
3. **Move, never copy.** If a `sdk-config.json` already exists at the project root (created by the scaffolding tool), move it to the served location and delete the original. A leftover duplicate at the project root silently diverges over time and can re-introduce authentication failures when someone edits the wrong copy.
|
|
234
|
+
|
|
235
|
+
**Verification criterion:** Navigating to `<origin>/sdk-config.json` in the browser returns the JSON contents. Also verify this from the same route path where the case flow will bootstrap.
|
|
236
|
+
|
|
237
|
+
**Required fields:**
|
|
238
|
+
|
|
239
|
+
The file must contain two sections — `serverConfig` and `authConfig`:
|
|
240
|
+
|
|
241
|
+
| Section | Field | Purpose |
|
|
242
|
+
| -------------- | ----------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
243
|
+
| `serverConfig` | `infinityRestServerUrl` | Pega Infinity REST API base URL |
|
|
244
|
+
| `serverConfig` | `appAlias` | Application alias configured in Pega |
|
|
245
|
+
| `serverConfig` | `sdkContentServerUrl` | Base URL for static SDK content (empty string = same origin) |
|
|
246
|
+
| `serverConfig` | `appPortal` | Portal name to load (empty string = auto-detect) |
|
|
247
|
+
| `serverConfig` | `appMashupCaseType` | Fully qualified case type class to embed |
|
|
248
|
+
| `serverConfig` | `excludePortals` | Array of portal names incompatible with the SDK (prevents auto-selection of admin/developer portals) |
|
|
249
|
+
| `authConfig` | `authService` | Authentication service identifier (typically `"pega"`) |
|
|
250
|
+
| `authConfig` | `mashupClientId` | OAuth client identifier for embedded/mashup mode |
|
|
251
|
+
| `authConfig` | `mashupUserIdentifier` | Operator identifier for the embedded session |
|
|
252
|
+
| `authConfig` | `mashupPassword` | Operator password (empty for OAuth-only flows) |
|
|
253
|
+
| `authConfig` | `portalClientId` | OAuth client identifier used during main-window redirect authentication |
|
|
254
|
+
| `authConfig` | `portalClientSecret` | Client secret for portal authentication (empty if public client) |
|
|
255
|
+
| `authConfig` | `portalGrantType` | OAuth grant type for portal auth (empty for default authorization code flow) |
|
|
256
|
+
|
|
257
|
+
**⚠️ CRITICAL — Portal credential keys and silent authentication hang:**
|
|
258
|
+
|
|
259
|
+
When the bootstrap module authenticates using a main-window redirect (which is the default for embedded mode), the SDK's configuration normalization reads the **portal-prefixed** credential keys (`portalClientId`, `portalClientSecret`, `portalGrantType`), not the mashup-prefixed ones.
|
|
260
|
+
|
|
261
|
+
If `portalClientId` is absent or empty, the authentication initializer classifies the session as custom-auth and returns **without ever resolving its readiness promise**. The result is a permanent silent hang:
|
|
262
|
+
|
|
263
|
+
- No network requests are made
|
|
264
|
+
- No error is thrown or logged
|
|
265
|
+
- The readiness signal never fires
|
|
266
|
+
- The UI remains in its "loading" state indefinitely
|
|
267
|
+
|
|
268
|
+
**Prevention:** Always populate `portalClientId` — typically with the same value as `mashupClientId`. The `portalClientSecret` and `portalGrantType` fields should be present (even if empty strings) to ensure the normalizer finds them.
|
|
269
|
+
|
|
270
|
+
### Step 3 — Create the bootstrap module
|
|
271
|
+
|
|
272
|
+
Create a module that handles the Pega SDK lifecycle. **This module's initialization must execute exactly once per page load**, regardless of how many times the host framework invokes component lifecycle methods.
|
|
273
|
+
|
|
274
|
+
**⚠️ CRITICAL — Initialization must be a module-scoped singleton:**
|
|
275
|
+
|
|
276
|
+
Store the bootstrap promise at module scope (outside any component, class instance, or framework lifecycle hook). If the host framework re-invokes initialization logic during development (e.g., dev-mode double invocation of mount/init callbacks for detecting side-effects), the singleton ensures:
|
|
277
|
+
|
|
278
|
+
- The first invocation performs authentication and bootstrap
|
|
279
|
+
- Subsequent invocations receive the already-resolved (or in-flight) promise
|
|
280
|
+
- No duplicate authentication attempts or race conditions occur
|
|
281
|
+
|
|
282
|
+
**Anti-pattern — guard flag + lifecycle cleanup cancellation:**
|
|
283
|
+
|
|
284
|
+
Do NOT combine a "has already started" boolean guard with a cancellation flag set during lifecycle cleanup. Under dev-mode double invocation:
|
|
285
|
+
|
|
286
|
+
1. First invocation starts authentication, sets the guard
|
|
287
|
+
2. Cleanup runs, sets the cancellation flag
|
|
288
|
+
3. Second invocation sees the guard and does nothing
|
|
289
|
+
4. The first invocation completes authentication, checks the cancellation flag, and aborts
|
|
290
|
+
5. Result: authentication succeeds but the readiness signal is never emitted — the UI hangs indefinitely showing a loading state
|
|
291
|
+
|
|
292
|
+
The module-scoped singleton avoids this entirely because it is immune to component lifecycle.
|
|
293
|
+
|
|
294
|
+
**Bootstrap responsibilities:**
|
|
295
|
+
|
|
296
|
+
1. **Authenticate** — use the SDK auth client to perform login (OAuth redirect or silent renewal)
|
|
297
|
+
2. **Bootstrap in embedded/mashup mode** — initialize the SDK runtime in mashup mode (not full portal), capturing the render context returned by bootstrap
|
|
298
|
+
3. **Create the component registry** — instantiate the SDK's component registry and register all components exported by the generated `pega-components/component-map` registry file
|
|
299
|
+
4. **Register the component creator** — tell the SDK runtime to use the registered components for rendering
|
|
300
|
+
|
|
301
|
+
This module should expose:
|
|
302
|
+
|
|
303
|
+
- A readiness signal (so the host app knows when Pega is ready)
|
|
304
|
+
- The render context (needed to mount the bridge component)
|
|
305
|
+
- The populated component registry
|
|
306
|
+
- A reference to the auth client (for logout)
|
|
307
|
+
|
|
308
|
+
### Step 4 — Wire the case launch trigger
|
|
309
|
+
|
|
310
|
+
The control was resolved and cleared in Step 0.1. If that gate was skipped, stop and run it now — this is the step that overwrites the customer's behaviour, and consent must already be on record before it does.
|
|
311
|
+
|
|
312
|
+
#### Step 4.1 — Attach the launch
|
|
313
|
+
|
|
314
|
+
**Wait for the bootstrap readiness signal before calling anything.** The call below reads the `PCore` global, which does not exist until the bootstrap module from Step 3 has resolved. A trigger the user can activate before then throws on an undefined global — and because bootstrap usually wins the race on a warm reload, it fails intermittently and looks like a network fault. Gate the control on the readiness signal that Step 3's module exposes: keep it inert until the signal fires, or await the signal inside the handler before proceeding.
|
|
315
|
+
|
|
316
|
+
On the trigger, call the SDK's mashup API to create a case. It takes three arguments, and an embedded flow needs all three:
|
|
317
|
+
|
|
318
|
+
| Argument | Value |
|
|
319
|
+
| -------- | --------------------------------------------------------------------------------- |
|
|
320
|
+
| 1 | The configured case type class |
|
|
321
|
+
| 2 | The app context constant — `PCore.getConstants().APP.APP` |
|
|
322
|
+
| 3 | An options object containing `pageName: 'pyEmbedAssignment'` and `startingFields` |
|
|
323
|
+
|
|
324
|
+
**⚠️ CRITICAL — `startingFields` keys must be property names on the case type.**
|
|
325
|
+
|
|
326
|
+
`startingFields` seeds values into the case being created. Its keys are not labels, not display names, and above all **not names from the customer's own domain model**. They must be properties the case type actually accepts at creation — the ones resolved from the server before wiring began. Having just analysed the customer's application is exactly what makes this easy to get wrong: their vocabulary is fresh, plausible, and has no relationship to what the case type declares.
|
|
327
|
+
|
|
328
|
+
Pega validates the whole payload as a unit. **If a single key does not resolve, the entire create call is rejected** — no case is created, no per-field detail comes back, and the response gives no indication which key was at fault. One wrong name is indistinguishable from a broken integration, which is why this is worth getting right rather than debugging.
|
|
329
|
+
|
|
330
|
+
Therefore:
|
|
331
|
+
|
|
332
|
+
- Use only the property names resolved from the server for this case type. If none were resolved, pass an empty object.
|
|
333
|
+
- Never guess, never map by resemblance, and never carry a name across from the customer's domain because it looks equivalent. A case-type property whose name or type happens to look like a plausible destination is the most dangerous match of all — seeding it puts the customer's data in the wrong place and the call succeeds, so nothing surfaces the error.
|
|
334
|
+
- Always pass the key, empty when there is nothing to seed.
|
|
335
|
+
|
|
336
|
+
**Report dropped pre-fill — do not let it disappear quietly.** When the customer's launch context had values that were clearly meant to seed the case and none of them map to a confirmed property, sending an empty object is correct but silent: the flow works, and the values the user already entered are simply gone. Tell them explicitly — name the properties the case type does accept, name the values that had no home, and state that pre-fill is off until the mapping is confirmed. That mapping is a question for whoever owns the case type; answer it with them, not by inference.
|
|
337
|
+
|
|
338
|
+
**⚠️ CRITICAL — omitting `pageName` renders the wrong thing.**
|
|
339
|
+
|
|
340
|
+
`pyEmbedAssignment` is what narrows the render to the assignment. Without it the runtime returns the **full case view** — stage navigation, a case summary panel, and Details / Case History tabs wrapped around the form. That is a portal experience, not an embedded one, and it is not what the customer asked to embed.
|
|
341
|
+
|
|
342
|
+
The failure is easy to miss because it still renders. Two tells:
|
|
343
|
+
|
|
344
|
+
- chrome the customer never asked for appears above and around the fields
|
|
345
|
+
- components that only exist in the case view (case summary, operator details, attachments) show up as fallback markers, which reads like a registry gap but is not one
|
|
346
|
+
|
|
347
|
+
**Do not invent options.** Only pass keys the mashup API documents. A flag whose name sounds like it suppresses case chrome does not narrow the render — `pageName` is the only thing that does.
|
|
348
|
+
|
|
349
|
+
Then reveal the render target resolved in Step 0.2 — open the dialog, navigate to the route, or show the region — so the flow becomes visible where the customer expects it.
|
|
350
|
+
|
|
351
|
+
If Step 0.4 established that the target does not survive a reload, this is where its first half goes: persist the launch context **before** the create call, since the authentication redirect can happen inside it. The restoring half belongs wherever the application starts up, so that the context is re-established before the flow is mounted.
|
|
352
|
+
|
|
353
|
+
Per Step 0.5, this create call must run on **every** launch. Anything that makes it fire only the first time — a guard tied to the runtime being set up rather than to the launch — leaves every later launch showing an empty target. If a guard is needed to stop a single launch creating two cases, key it to the launch and release it when the flow is dismissed.
|
|
354
|
+
|
|
355
|
+
**Verification criterion:** the target surface shows the assignment's fields and its action buttons, and nothing else — no stage indicator, no case-history tab, no case summary panel.
|
|
356
|
+
|
|
357
|
+
### Step 5 — Mount the bridge component
|
|
358
|
+
|
|
359
|
+
**Important:** Bootstrap alone renders nothing. The SDK initializes state and returns a render context, but no UI appears until the host application explicitly mounts the bridge component with that context.
|
|
360
|
+
|
|
361
|
+
Mount into the render target resolved in Step 0.2. What that means in practice differs by surface:
|
|
362
|
+
|
|
363
|
+
| Resolved target | What to mount into |
|
|
364
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
365
|
+
| A dialog | The customer's own dialog primitive, built the way their other dialogs are. The bridge mounts in its content area, and dismissal is wired to the cancellation event in Step 6 |
|
|
366
|
+
| A route or page | The component the route already rendered, replaced by the bridge. Keep the route's existing layout, navigation and page shell — only its content changes |
|
|
367
|
+
| A page region | The named region, in place. The surrounding page keeps rendering |
|
|
368
|
+
|
|
369
|
+
Do not introduce a surface the customer does not already use — if their application has no drawer, the flow does not arrive in one.
|
|
370
|
+
|
|
371
|
+
Mount the bridge once and keep it mounted, per Step 0.5. Dismissing the flow hides the target; it does not tear the bridge down. Whatever the customer's own surfaces use to hide content without discarding it is what applies here.
|
|
372
|
+
|
|
373
|
+
In that target:
|
|
374
|
+
|
|
375
|
+
1. Render the SDK bridge component, passing:
|
|
376
|
+
- The render context from bootstrap (contains the root `getPConnect` accessor)
|
|
377
|
+
- The populated component registry
|
|
378
|
+
- A fallback component (renders when a Pega-requested component is not in the registry)
|
|
379
|
+
2. Wrap with the SDK's required context providers (store context for state access, runtime context for environment)
|
|
380
|
+
3. The bridge component will recursively resolve and render Pega components from the registry as the case flow progresses
|
|
381
|
+
|
|
382
|
+
**CSS isolation considerations:**
|
|
383
|
+
|
|
384
|
+
Global CSS resets and normalizers commonly strip intrinsic sizing from inline vector graphics and remove default button styling. If the host application uses such resets, scope corrective rules to the Pega rendering container element rather than modifying the global styles:
|
|
385
|
+
|
|
386
|
+
- Inline vector graphics within the container should have constrained dimensions (not expand to fill their parent)
|
|
387
|
+
- Interactive elements within the container should retain cursor indicators
|
|
388
|
+
|
|
389
|
+
**Verification criterion:** After triggering a case launch, the form content (fields, labels, action controls) is visible and interactive within the resolved render target. The bridge is rendering — not just the container element alone.
|
|
390
|
+
|
|
391
|
+
### Step 6 — Handle flow lifecycle events
|
|
392
|
+
|
|
393
|
+
Subscribe to SDK lifecycle events to manage what happens when the case flow ends. What "return to the customer's UI" means depends on the render target resolved in Step 0.2: a dialog closes, a route navigates back to where the trigger was, and a region reverts to what it showed before.
|
|
394
|
+
|
|
395
|
+
| Event | Action |
|
|
396
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
397
|
+
| Cancellation | Dismiss the render target and return the user to where they triggered the flow |
|
|
398
|
+
| Flow completion (assignment processing done) | Dismiss the target, optionally showing a success message or redirecting |
|
|
399
|
+
| Error | Display an error state or fallback, log for debugging |
|
|
400
|
+
|
|
401
|
+
Unsubscribe from these events on component teardown to prevent memory leaks.
|
|
402
|
+
|
|
403
|
+
### Step 7 — Verify the integration
|
|
404
|
+
|
|
405
|
+
Wiring is not finished until the flow has been observed running. Read and execute `{{SKILL_DIR}}/embedded-flow/run-and-verify-integration.md`, which turns the verification criteria stated throughout this skill into executed checks and defines what may be repaired automatically.
|
|
406
|
+
|
|
407
|
+
At minimum it must establish that:
|
|
408
|
+
|
|
409
|
+
1. The project builds, type-checks and lints cleanly
|
|
410
|
+
2. The Pega runtime initializes and its readiness signal fires
|
|
411
|
+
3. Triggering the case launch renders the form with the generated components, and no fallback component stands in for a missing registry entry
|
|
412
|
+
4. A generated field retains its value after the commit event
|
|
413
|
+
5. Completing or cancelling the flow returns the UI to its previous state
|
|
414
|
+
6. No console errors occur during any of the above
|
|
415
|
+
|
|
416
|
+
Do not report the integration as complete on static checks alone.
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Architecture Summary
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
424
|
+
│ Customer's Application │
|
|
425
|
+
│ │
|
|
426
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
427
|
+
│ │ Customer's UI (nav, pages, routing, layout) │ │
|
|
428
|
+
│ │ │ │
|
|
429
|
+
│ │ [Trigger] ──→ SDK mashup API: create case │ │
|
|
430
|
+
│ │ │ │
|
|
431
|
+
│ │ ┌─────────────────────────────────────────────────┐ │ │
|
|
432
|
+
│ │ │ Pega Rendering Container │ │ │
|
|
433
|
+
│ │ │ │ │ │
|
|
434
|
+
│ │ │ SDK Bridge Component │ │ │
|
|
435
|
+
│ │ │ ↓ resolves from registry │ │ │
|
|
436
|
+
│ │ │ pega-components/ (generated, customer-styled) │ │ │
|
|
437
|
+
│ │ │ ↓ wired to │ │ │
|
|
438
|
+
│ │ │ PConnect (Pega runtime state + actions) │ │ │
|
|
439
|
+
│ │ └─────────────────────────────────────────────────┘ │ │
|
|
440
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
441
|
+
│ │
|
|
442
|
+
└─────────────────────────────────────────────────────────────┘
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## Reference Implementation
|
|
448
|
+
|
|
449
|
+
The Pega SDK repository includes a mashup/embedded sample application that demonstrates this exact integration pattern. When implementing for a customer, adapt the pattern to match their framework's idioms (lifecycle management, dependency injection, component rendering, event subscription).
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
## Troubleshooting
|
|
454
|
+
|
|
455
|
+
Common integration failures and their resolutions. These are ordered by how they typically manifest during first-time setup.
|
|
456
|
+
|
|
457
|
+
| Symptom | Cause | Resolution |
|
|
458
|
+
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
459
|
+
| Application hangs indefinitely on startup — no network requests, no errors in console, readiness signal never fires | The `portalClientId` field is missing or empty in `sdk-config.json`. The auth initializer classifies the session as custom-auth and returns without resolving. | Add `portalClientId` to the `authConfig` section (typically the same value as `mashupClientId`). Ensure `portalClientSecret` and `portalGrantType` are also present (even as empty strings). |
|
|
460
|
+
| Authentication succeeds (network shows token exchange) but the readiness signal never fires; UI stays in loading state | The bootstrap initialization ran more than once and a lifecycle-cleanup cancellation flag aborted the in-flight run after auth completed. | Ensure bootstrap is a module-scoped singleton promise (see Step 3). Remove any guard + cancellation flag pattern. |
|
|
461
|
+
| The Pega container is mounted but displays nothing — an empty box after case creation | The host application bootstrapped the SDK but never rendered the bridge component with the returned render context. | Confirm that after the readiness signal fires, the bridge component is rendered with the render context's `getPConnect` accessor, inside the SDK's store context provider (see Step 5). |
|
|
462
|
+
| 404 errors for the ConstellationJS core script | The core script is not being served from the referenced path. | Verify the reference resolves from the route the flow launches at, and that the toolchain serves the dependency directory. If it does not, serve a copy from the static assets directory instead (see Step 1.1). |
|
|
463
|
+
| 404 for `sdk-config.json` | The configuration file is not at the application's served web root, or the route depth at bootstrap time causes the relative fetch to resolve against a nested path. | Move the file to the project's served static directory. If bootstrapping from a nested route, set an explicit document base URL (see Step 2). |
|
|
464
|
+
| Inline vector graphics (icons) render at enormous size, filling their parent container | Global CSS resets strip intrinsic sizing from SVG elements. | Scope size constraints on inline vector graphics to the Pega rendering container (see Step 5 CSS isolation note). |
|
|
465
|
+
| Action buttons, stage indicators, or navigation controls render as unstyled text | The SDK adapter package's stylesheet is not imported. These components use class-based styling that requires the stylesheet to be loaded. | Import the stylesheet in the application entry point as described in Step 1.2. |
|
|
466
|
+
| Case creation renders full case chrome (summary bar, stage progress, case history) instead of just the embedded form | The case was created without `pageName: 'pyEmbedAssignment'`. The server defaults to the full case view. | Pass all three arguments to the mashup API's case-creation call, including the embedded page name (see Step 4.1). |
|
|
467
|
+
| OAuth redirect opens a blank page or fails silently | The OAuth callback assets (`auth.html`, `authDone.js`) are missing from the served web root. | Place the auth callback assets as described in Step 1.2. |
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## Notes
|
|
472
|
+
|
|
473
|
+
- The generated `pega-components/` folder has zero dependencies beyond the customer's existing UI library and the Pega SDK packages. No additional design system installation is needed.
|
|
474
|
+
- The bootstrap module should handle token refresh/silent renewal automatically via the SDK auth client.
|
|
475
|
+
- If the customer's app already has authentication, coordinate with their auth flow — the SDK auth client can share tokens if the same OAuth provider is used.
|
|
476
|
+
- The Pega rendering container can be a modal, a sidebar, an inline section, or a full page. Which one is not a matter of taste — it is resolved in Step 0.2 from what the user asked for or from what their application already does.
|