From 7a899b48b9f2d57fc28e90e6c15d8fb2900371d0 Mon Sep 17 00:00:00 2001 From: Pedro Bini Date: Tue, 20 Oct 2026 13:57:08 -0300 Subject: [PATCH 1/2] Document agent, agent.pia and agent tracking in README Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d472f061..e2098fb2 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,16 @@ const constructorio = new ConstructorioClient({ After instantiating an instance of the client, seven modules will be exposed as properties to help retrieve data or send behavioral events: `search`, `browse`, `autocomplete`, `recommendations`, `quizzes`, `agent`, and `tracker`. +#### AI Shopping Agent and Product Insights Agent + +- [`agent`](https://constructor-io.github.io/constructorio-client-javascript/module-agent.html) retrieves AI Shopping Agent (ASA) results as a stream. +- [`agent.pia`](https://constructor-io.github.io/constructorio-client-javascript/module-pia.html) retrieves Product Insights Agent (PIA) questions and answers. +- [`tracker`](https://constructor-io.github.io/constructorio-client-javascript/module-tracker.html) has the `trackAgent*` methods for ASA events and the `trackProductInsightsAgent*` methods for PIA events. + +The `assistant` property is deprecated. Use `agent` instead. + +`agent` receives results through the browser `EventSource` interface. React Native does not include `EventSource`. If you use `agent` in React Native, add an `EventSource` polyfill. + #### Dispatched events Modules may dispatch custom events on the browser `window` with response data when a request has been completed. The event name follows the following structure: `cio.client.[moduleName].[methodName].completed`. Example consuming code can be found below: From 10706c1da38b2473d9f66eb5e6b1d723c16a6716 Mon Sep 17 00:00:00 2001 From: mudaafi Date: Thu, 22 Oct 2026 03:03:35 +0800 Subject: [PATCH 2/2] update formatting --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2098fb2..442dd07d 100644 --- a/README.md +++ b/README.md @@ -39,17 +39,18 @@ const constructorio = new ConstructorioClient({ After instantiating an instance of the client, seven modules will be exposed as properties to help retrieve data or send behavioral events: `search`, `browse`, `autocomplete`, `recommendations`, `quizzes`, `agent`, and `tracker`. -#### AI Shopping Agent and Product Insights Agent +### AI Shopping Agent and Product Insights Agent - [`agent`](https://constructor-io.github.io/constructorio-client-javascript/module-agent.html) retrieves AI Shopping Agent (ASA) results as a stream. - [`agent.pia`](https://constructor-io.github.io/constructorio-client-javascript/module-pia.html) retrieves Product Insights Agent (PIA) questions and answers. - [`tracker`](https://constructor-io.github.io/constructorio-client-javascript/module-tracker.html) has the `trackAgent*` methods for ASA events and the `trackProductInsightsAgent*` methods for PIA events. -The `assistant` property is deprecated. Use `agent` instead. +#### Note: +1. The `assistant` namespace is deprecated. Use `agent` instead. -`agent` receives results through the browser `EventSource` interface. React Native does not include `EventSource`. If you use `agent` in React Native, add an `EventSource` polyfill. +2. `agent` receives results through the browser `EventSource` interface. React Native does not include `EventSource`. If you use `agent` in React Native, add an `EventSource` polyfill. -#### Dispatched events +### Dispatched events Modules may dispatch custom events on the browser `window` with response data when a request has been completed. The event name follows the following structure: `cio.client.[moduleName].[methodName].completed`. Example consuming code can be found below: