The Whisky Exchange
Integration preview / V1
A world of fine spirits

THE WHISKY EXCHANGE

Your personal guide to the world of whisky and fine spirits.

From celebrated classics to hidden gems, discover the right bottle for every taste, occasion and budget.

FOR THE TWE DEVELOPMENT TEAM

Integration workbench

Plain HTML + JavaScript

Public API

Demo basket only. Recommendations always come from Constructor.

Event console 0

Every named callback is mirrored here through onEvent. Select an event to inspect its payload and Constructor identifiers.

INTEGRATION REFERENCE

Host Application Callbacks

Callbacks available to the host application when integrating the AI Shopping Agent.

Example host integration

Complete example: all callbacks and onEvent

IMPLEMENTATION

Host Application Integration

Production-ready embed

Use this minimum integration to load and control The Bottle Curator from an existing page. The published bundle includes React and its runtime dependencies; load the accompanying stylesheet before initialising the agent.

Required assets

Load both assets from the production host. Font Awesome is included below only because the example keeps the optional sparkles icon.

  • https://asa-demo.thewhiskyexchange.com/twe-shopping-agent.css
  • https://asa-demo.thewhiskyexchange.com/twe-shopping-agent.js

No separate React, configuration file or package installation is required for the published TWE bundle.

The cta-button classes belong to the host page. Keep them when the host already loads TWE’s button styles, or replace them with the host’s own button classes.

Initialisation and callbacks

window.TweShoppingAgent.init(options)
Mounts the agent. Set elementId to the ID of the mount element; it defaults to twe-shopping-agent.
config.agentName
Sets the visible name. Optional controls include dialogWidth, persistence and debug.
events.onAgentOpen(event)
Registers a named callback. The corresponding event envelope has eventName: "agent_open".
onEvent(event)
Receives every event after its named callback. See the callback reference above for the complete event list.

Public instance methods

open(), close(), expand(), restore(), setDialogWidth(width), resetConversation() and destroy().

The hosted production bundle is preconfigured. A separately built private bundle must receive a Constructor key through apiKey or its build-time configuration.

twe-shopping-agent.js contains the React application used by the host page. Load it before initialising or calling the AI Shopping Agent. See the configuration and callback references above for all supported options.