Skip to content

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

Open
wants to merge 16 commits into
base: southworks/add/copilotstudio-webchat
Choose a base branch
from

Conversation

kylerohnmsft
Copy link

  • 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

@kylerohnmsft kylerohnmsft self-assigned this Jun 19, 2025
@kylerohnmsft kylerohnmsft marked this pull request as draft June 19, 2025 21:12
@kylerohnmsft
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@kylerohnmsft kylerohnmsft changed the base branch from southworks/test/copilot-webchat to main June 19, 2025 21:20
@kylerohnmsft kylerohnmsft marked this pull request as ready for review June 19, 2025 21:24
@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 21:24
Copilot

This comment was marked as outdated.

@kylerohnmsft kylerohnmsft changed the base branch from main to southworks/add/copilotstudio-webchat June 19, 2025 21:35
@kylerohnmsft kylerohnmsft requested a review from Copilot June 19, 2025 21:35
Copy link
Contributor

@Copilot Copilot AI left a 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 }

Copy link
Collaborator

@sw-joelmut sw-joelmut left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants