codeapp-js
v2.0.3
Published
JavaScript library with samples and starter app for Power Apps Code Apps.
Readme
codeapp-js
JavaScript library, starter app, and sample apps for building Power Apps Code Apps with standard web technologies.
The repository is the primary source of truth for the project. The public site at codeappjs.com is useful for background and additional docs, but this repo reflects the latest files, examples, and starter assets.
What this repo includes
- A deployable starter app in
codeApp/ - Runtime files in
codeApp/dist/includingcodeapp.js,power-apps-data.js, and connector assets - Example apps for Dataverse, Outlook, SharePoint, Groups, and full app scenarios under
examples/ - Connector schemas under
schemas/ - AI instructions and skills used for code-first app generation under
AI/
Quick start
Prerequisites
- Node.js
- Power Platform CLI (
pac) for deployment - A Power Platform environment with Code Apps enabled
- Optional: VS Code with Copilot and Power Platform Tools
No package install is required for local serving. The repo uses a built-in Node static server.
Run a static server for the repo:
npm run startOpen the starter code app directly:
npm run start:codeappThe starter app lives in codeApp/dist/ and is served without a build step.
Starter app structure
The default starter app is in codeApp/.
codeApp/power.config.json: Power Apps Code App configurationcodeApp/dist/index.html: app shell and import map for@microsoft/power-apps/datacodeApp/dist/index.js: starter boot filecodeApp/dist/codeapp.js: helper runtime used by samples and generated appscodeApp/dist/power-apps-data.js: Power Apps data runtime bundlecodeApp/dist/connectors/: generated connector support files
Deploying a code app
- Update
power.config.jsonwith your target environment details. - Authenticate with Power Platform CLI.
- Push the app to your environment.
Example:
pac auth create --environment https://<yourorg>.crm.dynamics.com
pac env who
pac code push --solutionName MyCodeAppThe app packages the configured buildPath from power.config.json, which defaults to ./dist in the included starter and examples.
Examples
The examples/ folder contains both focused demos and fuller application samples.
examples/dataverse Demo/: Dataverse-focused sampleexamples/groups Demo/: Microsoft 365 Groups sampleexamples/myProfile/: Office 365 Users sampleexamples/outlook Demo/: Outlook mail and calendar sampleexamples/sharepoint demo/: SharePoint sampleexamples/apps/kanban/: fuller app example with generated source assetsexamples/apps/planning Poker/: planning poker app assetsexamples/apps/solution explorer/: solution explorer app assetsexamples/apps/Solution Share/: solution sharing sampleexamples/apps/todo/: todo app sample
Each sample includes its own power.config.json, and some include additional notes or agent artifacts.
Working with connectors
Connector schemas for common services are stored in schemas/, and example-specific generated assets may appear under an app's src/generated/ or dist/connectors/ folders.
This repo includes patterns and examples for:
- Dataverse
- SharePoint
- Office 365 Outlook
- Office 365 Users
- Office 365 Groups
- Jira
- Teams
- SQL
- Key Vault
Repository layout
codeApp/ Starter code app and runtime assets
examples/ Demo apps and fuller sample applications
schemas/ Connector schema files
AI/ Skills and prompts for code generation workflows
agent/ Agent planning and supporting artifactsAdditional documentation
- Project site: https://codeappjs.com
- Microsoft Learn overview: Power Apps Code Apps
- Upstream Microsoft repo: microsoft/PowerAppsCodeApps
If you are starting fresh, begin with codeApp/, verify the app locally, then copy or adapt one of the examples that matches your connector and data source needs.
