LogoLogo
Contact API support
  • Build apps
  • Site Templates
  • REST API Reference
  • Storefronts (JS API)
  • Webhook automations
  • Discounts
  • Guides
  • Changelog
  • Ecwid storefronts overview
  • Get started
    • Storefront customization options
    • Quickstart: customize storefront with Ecwid JS API
  • Track Storefront events
    • "Page is loaded" events
    • "Customer logged in" event
    • "Cart details are changed" event
    • "New order is placed" event
    • "Instant Site section load" events
  • Get Storefront details
    • Get Ecwid store ID
    • Get storefront language and currency
    • Get visitor location
    • Get public app details
  • Manage customers on the storefront
    • Get logged in customer's details
    • Manage customer's cookie consent
    • Log out customer
  • Open page on the storefront
    • Overview of open page options
    • Open product pages with params
    • Open category pages with params
    • Open search page with params
    • Open account pages with params
  • Manage cart and checkout
    • Get cart details
    • Add product to the cart
    • Remove products from the cart
    • Fully clear the cart
    • Create pre-filled shopping carts
    • Calculate cart details
    • Send customer to the checkout
    • Set customer's email for the checkout
    • Set customer's comments for order
    • Set customer's shipping and billing addresses
    • Set custom order referer
  • Store configuration settings
    • Overview
    • Behavioral configs
    • Design configs

Lightspeed® 2025

On this page
  • Step 1. Set up a custom application in your store
  • Step 2: Connect a self-hosted JS file with the app
  • Step 3: Initialize Ecwid JS API in the file

Was this helpful?

  1. Get started

Quickstart: customize storefront with Ecwid JS API

PreviousStorefront customization optionsNext"Page is loaded" events

Last updated 3 months ago

Was this helpful?

To start working on your storefront customization project, you need a self-hosted JavaScript file connected to an app in your Ecwid store.

In the following guide, you'll start with a new JS file running on your server and end up with an app that runs your script file and initializes Ecwid JS API every time the storefront is opened by a customer.

Step 1. Set up a custom application in your store

To make any code changes to the storefront, you need a custom app to be installed in your store. If you don't have a custom application yet, jump into the Building apps section.

Step 2: Connect a self-hosted JS file with the app

To get started with the JS API, you'll need to set up a self-hosted JS file running on your server all the time. This file, for example my_script.js, will automatically load and run on the storefront every time it's opened.

To set it up, get a static HTTPS link to the file, for example https://myserver.com/js/my_script.js, and request an app update from the API Support team.

Once the app is updated, your script file automatically loads and runs on the storefront. If the app is installed in multiple Ecwid stores, the script runs in all of their storefronts.

Step 3: Initialize Ecwid JS API in the file

Once you have the JS file running on the storefront, you'll need to initialize Ecwid JS API in it. This way, you can unlock the full potential of storefront customizations and make your code more simplified in a lot of cases.

To do so, simply start your code with the following function:

Ecwid.OnAPILoaded.add(function() {
	console.log("Ecwid JS API is loaded.");
});

Now you can utilize all methods described below, along with the configuration settings. Learn all JS API features:

Automate your code execution

Client-side access to store details

Manage your customers

Work with checkout and cart

Redirect customers between pages

Change store behavior with configs

Track Storefront events
Get Storefront details
Manage customers on the storefront
Manage cart and checkout
Open page on the storefront
Behavioral configs
Set up a custom app
Request application update