
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
headless-js-api
Advanced tools
@lightspeed/headless-js-api is a client-side JavaScript/TypeScript library for interacting with the Ecwid resources. It provides a strongly-typed, modern interface to access store data and trigger UI functionalities within third-party applications, themes, or custom integrations.
This library is designed for both browser and Node.js environments.
@lightspeed/headless-js-api.axios for HTTP requests.yarn add @lightspeed/headless-js-api
Here's a base example of how to initialize the API client and retrieve a store profile:
import { initStorefrontApi, getStoreProfile, GetStoreProfileResponse } from '@lightspeed/headless-js-api/api';
import { getStoreId } from '@lightspeed/headless-js-api/storefront';
initStorefrontApi({
publicToken: 'YOUR_PUBLIC_TOKEN',
storeId: 'YOUR_STORE_ID',
baseURL: 'https://app.ecwid.com/api/v3/'
});
const storeId = await getStoreId();
const response: GetStoreProfileResponse = await getStoreProfile({ storeId });
This library provides a client-side interface for a subset of the functionalities available in the Ecwid REST API. For a complete list of all available backend API endpoints and their detailed documentation, refer to the official Ecwid API Reference.
The underlying HTTP client is axios. The library focuses on fetching fresh data and does not implement persistent caching.
getApiConfig(): ApiConfig – Retrieves or sets the current API configuration.searchProducts(params?: SearchProductsParams): Promise<SearchProductsResponse> – Searches for products based on various criteria.getProduct(params: GetProductParams): Promise<GetProductResponse> – Fetches a single product by its ID.src/api/products/ as implemented.)PaginatedResponse<T> – Generic type for API responses that include pagination details.SearchParams – Basic type for search parameter objects.SortBy – Enum for available product sort orders.Product, ProductAttribute, etc., are available and exported from src/api/products/types/.(The list of available methods will expand as more API endpoints are implemented and exported from the root index.ts file.)
Each call to an API method will result in a new HTTP request. The library does not implement request deduplication or persistent caching.
Methods that return Promises will reject in case of errors (e.g., network issues, invalid parameters, API errors from the backend). Errors will typically be instances of Error or a custom error type derived from it, containing relevant information about the failure. Use try...catch blocks for asynchronous operations.
All API methods provided by this library are public and read-only. Access requires a valid public token, which is used to authenticate requests. The library does not handle or store authentication tokens beyond what is required for public API access. All data transmission is performed over HTTPS.
axios provides HTTP request capabilities in Node.js.This library adheres to Semantic Versioning (SemVer).
A CHANGELOG.md file is maintained in the package root to document changes, additions, and fixes for each version.
FAQs
Headless JS client for Ecwid public API
We found that headless-js-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.