Asyntai AI Search for Medusa. A search bar that understands what a shopper means and answers from your catalogue.
A search bar that understands what a shopper means, and answers from your own catalogue.
Somebody types "something warm for cold weather" and the bar finds your sweatpants, although not one of those words is in the product name. It answers with the price, the discount and the stock your store is showing right now, because it reads your catalogue rather than your pages.
Add it to :
Then create the plugin's table and restart:
npx medusa db:migrateMedusa is headless, so your storefront is a separate application and this plugin cannot edit it. Paste the tag the admin screen shows you into your storefront, once:
Everything else, the site id, the placement, the accent colour, and whether the bar shows at all, arrives from that address. Change a setting in Medusa and your storefront follows within five minutes. You never edit the storefront again.
The starter uses the Next.js App Router, which drops a plain tag written into . Use in instead:
The starter also ships no search box of its own, so there is nothing for the bar to replace. Set Where the bar goes to Only where I put a placeholder and add this wherever you want it:
Set Product path to for your own default region, for example . That is how the starter addresses a product, and it is how search results link to one.
| Setting | What it does |
|---|---|
| Storefront address | Where shoppers are. Asyntai indexes it, and product links are built from it. |
| Backend address | Where this Medusa answers. The catalogue feed and the tag live here, so Asyntai has to be able to reach it. |
| Product path | How your storefront addresses a product. stands for the product. |
| Where the bar goes | Replace the storefront's own search box, or render only where you put a placeholder. |
| Search box to replace | A CSS selector, for a storefront whose search box is not found automatically. |
| Accent colour | The bar's own colour. |
| Placeholder text | What the empty bar says. |
| Let Asyntai read the catalogue | On, the bar answers with live prices and stock. Off, it answers from your pages alone. |
Changing the Backend address after connecting means Asyntai still reads the catalogue from the old one. The screen says so, and pressing Connect again fixes it.
The plugin exposes one read-only endpoint, , and Asyntai is its only caller. Every request carries a timestamp and an HMAC-SHA256 signature keyed with a token this store generated and handed over once, during connect. The store refuses a request whose clock is more than five minutes out, so a captured address stops working almost at once.
It is deliberately not under . A route needs a publishable API key, and a key that a server uses is one more secret to hold for no gain.
MIT.
Email hello@asyntai.com, or ask the chatbot at asyntai.com.
npm install @asyntai/medusa-plugin-ai-search1module.exports = defineConfig({2 // ...3 plugins: [4 {5 resolve: "@asyntai/medusa-plugin-ai-search",6 options: {},7 },8 ],9})<script async src="https://YOUR-MEDUSA/asyntai-search/loader"></script>1import Script from "next/script"2
3// inside <body>4<Script5 src="https://YOUR-MEDUSA/asyntai-search/loader"6 strategy="afterInteractive"7/><div data-asyntai-search />