The JavaScript library, esales-api, is built on top of the Storefront API v3 and is designed to make it easy to communicate with Voyado Elevate via a browser or JavaScript runtime (like Node.js, Deno, and more). It provides methods to make HTTP requests available in the API as well as TypeScript models of the response objects.
Installation
The @apptus/esales-api package is available for installation via npm.
API instantiation
To work with the esales-api, the clusterId received during customer onboarding (or in the credentials tab in the Elevate app) is required, as well as the correct IDs for both market and locale. Additionally, a touchpoint with either 'desktop' or 'mobile' must be set. Below, the API object is instantiated as a constant, api.
Key handling
The esales-api should be instantiated with a session property, which should be a function that returns the session and customer key to use. For more information on the key format and about identifying visitors, see Visitor identification.
Synchronous usage
Usage with Promise
Additionally, the library offers a way to automatically handle session and customer keys in the browser. They will be generated and locally persisted upon request to localStorage, and there are methods to update or reset keys, which should be used when visitors sign in or out.
Notifications
The JavaScript library includes methods for making notifications of each type. Once the API object has been instantiated, notifications can easily be made, as session and customer keys are automatically applied. Notifications are made via fetch() with the keepalive flag, so that browsers do not terminate the requests before they complete, such as when sending a click notification when a link is pressed.
All examples below have instantiated the API object as a constant, api.
Click
Add to cart
Add favorite
Remove favorite
Queries
Queries can be made by passing query parameters as an object and, for most types of queries, an optional body. The body is used to configure the types of data that will be returned from the API.
All examples below have instantiated the API object as a constant, api, and will therefore automatically include query parameters for market, locale, touchpoint, sessionKey, and customerKey. They show minimal usage: only the required parameters, and no request body. For the full list of parameters and body options, see the API specification.
Autocomplete
Cart page
Content information
Content search page
Landing page
Navigation tree
Product page
Search page
Last modified on September 11, 2026