Skip to content

feat(order-export): greet shoppers with a storefront welcome message - #5

Merged
pronob1010 merged 1 commit into
mainfrom
example/order-export-storefront-script
Oct 8, 2026
Merged

pronob1010 merged 1 commit into
mainfrom
example/order-export-storefront-script

Conversation

@pronob1010

Copy link
Copy Markdown
Collaborator

Adds a fifth step to Order Export: a storefront script that greets shoppers with a small welcome message, the kind a live-chat app shows, with a close button.

  • storefront/welcome.js: plain JavaScript in its own shadow root, so the store's CSS can't reach in and its own can't leak out. "Hi! Are you looking for something?", or "Any questions about this product?" on a product page, following window.FlyCommerce.pageType and the flycommerce:page event. × closes it, and it stays closed while the shopper browses. Reads no cookies, storage or forms.
  • src/storefront.ts serves it at GET /storefront/welcome.js; app-config.json declares it under storefront.scripts with load: "idle".
  • npm run dev passes the scripts to the emulator and prints the example storefront at /storefront.
  • test/storefront.test.ts: declared on the app's own host, served as JavaScript, run by the emulator's storefront (fails if the route and the declared path drift apart).
  • TUTORIAL step 5, README, AGENTS.md and the repo README updated.
  • SDK packages now ^0.1.0-next.1 (the first preview with storefront scripts).

Checked in a browser on the emulator's storefront: the message appears, changes on the product page, and closes.

@pronob1010
pronob1010 merged commit 30139c8 into main Oct 8, 2026
1 check passed
@pronob1010
pronob1010 deleted the example/order-export-storefront-script branch October 8, 2026 02:17
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.

1 participant