-
Notifications
You must be signed in to change notification settings - Fork 12
Add-copilotstudio webchat react test sample #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: southworks/add/copilotstudio-webchat
Are you sure you want to change the base?
Add-copilotstudio webchat react test sample #403
Conversation
kylerohnmsft
commented
Jun 19, 2025
- Added a test sample for implementation of a Direct to Engine connection between Copilot Studio and the Webchat UI as a standalone React component
- Example of the FluentThemeProvider style wrapper for Webchat
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a test sample for integrating Copilot Studio with a WebChat UI as a standalone React component, including support for a Direct to Engine connection and the FluentThemeProvider style wrapper.
- Introduces a new React sample project with configuration (tsconfig, build-env.js), source code (index.tsx, Chat.tsx, acquireToken.ts), public assets (index.html, index.css), and documentation (README.md).
- Updates the agents-hosting package tests and source related to authentication issuers, as well as project-wide dependency overrides in package.json.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
test-agents/copilotstudio-webchat-react/tsconfig.json | New TypeScript configuration for the sample project |
test-agents/copilotstudio-webchat-react/src/index.tsx | Entry point rendering the Chat component |
test-agents/copilotstudio-webchat-react/src/acquireToken.ts | Implements token acquisition using MSAL |
test-agents/copilotstudio-webchat-react/src/Chat.tsx | Main chat component integrating FluentThemeProvider and WebChat |
test-agents/copilotstudio-webchat-react/public/index.html | HTML template for the sample |
test-agents/copilotstudio-webchat-react/public/index.css | CSS styles to support full viewport usage |
test-agents/copilotstudio-webchat-react/package.json | Project configuration and dependency declarations |
test-agents/copilotstudio-webchat-react/build-env.js | Environment configuration file for build-time injection |
test-agents/copilotstudio-webchat-react/README.md | Detailed setup and usage documentation for the sample |
packages/agents-hosting/test/hosting/oauthflow.test.ts | Test updates for CloudAdapter configuration regarding issuers |
packages/agents-hosting/src/baseAdapter.ts | Sets default for authConfig issuers to undefined |
packages/agents-hosting/src/auth/authConfiguration.ts | Updates issuer type allowing a single string or a non-empty array |
package.json | Adds dependency overrides and updates engine requirements |
Comments suppressed due to low confidence (3)
packages/agents-hosting/src/auth/authConfiguration.ts:38
- The updated type for issuers now accepts either a single string or a non-empty array, which is a good improvement; please update any related documentation and ensure client code handles both cases appropriately.
issuers: string | [string, ...string[]] | undefined
packages/agents-hosting/test/hosting/oauthflow.test.ts:38
- Changing issuers from an empty array to undefined may have unintended consequences if downstream logic expects an array. Please verify that all parts of the code handling issuers properly check for undefined.
const fakeAdapter = new CloudAdapter({ clientId: 'fakeClientId', clientSecret: 'fakeClientSecret', issuers: undefined })
packages/agents-hosting/src/baseAdapter.ts:56
- Ensure that setting issuers to undefined is consistently handled in adapter logic, especially where iteration or validation over issuers is performed.
authConfig: AuthConfiguration = { issuers: undefined }
…tudio-webchat-react
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kylerohnmsft, the sample looks good, I just pointed out a few minor changes.
Also, we should add the Copyright header to all .js and .ts files, I think it also applies for .tsx, and there are a few Copilot comments that are worth considering applying.