Skip to content

feat: update embedded web API parity - #33

Merged
Morten Barklund (barklund) merged 6 commits into
mainfrom
update-the-embedded-web-package-with-the-latest-api-dxa-3696
Jul 13, 2026
Merged

feat: update embedded web API parity#33
Morten Barklund (barklund) merged 6 commits into
mainfrom
update-the-embedded-web-package-with-the-latest-api-dxa-3696

Conversation

@barklund

@barklund Morten Barklund (barklund) commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Sync embedded payload types with the current assistant embedded API surface, including document options, template source filters, template assembler section field access, and app configuration.
  • Add the missing showDeviceLinkQR public wrapper and expose it through the React API hook so component APIs match the generated embedded API.
  • Expand the embedded web demos with app configuration, supported template source options, template assembler field access, document generation options, and device-link QR controls.

Replaces #31 because sync/embedded-types is an automation-owned branch that gets reused.

Fixes DXA-3696

Copilot AI review requested due to automatic review settings July 13, 2026 07:25
@linear-code

linear-code Bot commented Jul 13, 2026

Copy link
Copy Markdown

DXA-3696

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the embedded-web package’s public types and demos to match the latest embedded Assistant API surface (template sources/inline templates, forced first-document generation, document generation limits), and adds a missing showDeviceLinkQR wrapper so the component API matches the generated embedded API.

Changes:

  • Synced/expanded embedded payload + response types (inline templates, template source options, maxGenerated, device-link response/status).
  • Added showDeviceLinkQR action/type wiring and a new public CortiEmbedded.showDeviceLinkQR() wrapper.
  • Updated the HTML + React demos to showcase the new configuration and template capabilities.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/types/responses.ts Adds companionApp to ConfigureAppResponse and introduces ShowDeviceLinkQRResponse.
src/types/protocol.ts Adds showDeviceLinkQR to the protocol action/request unions and formats unions consistently.
src/types/payloads.ts Adds inline template structures, expands template source options, and adds maxGenerated.
src/types/generated/interview-details.ts Reformats the state union type (no behavior change).
src/types/config.ts Introduces CompanionAppConfig and wires it into ConfigureAppPayload.
src/types/api.ts Exposes showDeviceLinkQR on the public API typing surface.
src/public-types.ts Re-exports/extends public types to include device-link types and showDeviceLinkQR.
src/CortiEmbedded.ts Implements the new showDeviceLinkQR public wrapper via postMessage.
demo/typescript-demo.html Expands demo payload examples to cover new config/template/document options.
demo/react-demo.tsx Adds richer demo payload examples and minor formatting updates.
demo/index.html Expands demo payload examples to cover new config/template/document options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/types/api.ts
Comment thread src/public-types.ts
Comment thread src/CortiEmbedded.ts
Comment thread demo/react-demo.tsx Outdated

@hriczzoli Zoltan Hricz (hriczzoli) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great I just think some of the types have drifted a bit, probably due to the automatic PR:

  • types/api navigate is defined to accept a string but in CortiEmbedded we do still accept an object as well. But the main thing is the in /public-types we have the correct interface
  • here we say setInteractionOptions PATCHES, but here the DOCSTRING is slightly contradictory

Comment thread demo/react-demo.tsx Outdated
@barklund
Morten Barklund (barklund) merged commit 5b6e854 into main Jul 13, 2026
9 of 10 checks passed
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.

3 participants