
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
liferay-headless-rest-client
Advanced tools
⚠️ Project Disclaimer: This library is a community-maintained project and is not officially supported or maintained by Liferay, Inc. It is provided as-is with no warranty or guarantee of support from Liferay.
A TypeScript client library for interacting with Liferay's Headless REST APIs. This library provides type-safe access to various Liferay services including Commerce, Content Management, User Management, and more. It is maintained by the community to provide a better developer experience when working with Liferay's REST APIs.
This library is designed to work with Liferay Portal 2025 Q2
and above. The API endpoints and types are generated from Liferay's OpenAPI specifications for these versions.
npm install liferay-headless-rest-client
# or
yarn add liferay-headless-rest-client
# or
bun add liferay-headless-rest-client
import { createClient } from 'liferay-headless-rest-client';
import { getProductsPage } from 'liferay-headless-rest-client/headless-commerce-admin-catalog-v1.0';
// Create a client instance
const client = createClient({
baseUrl: 'https://your-liferay-instance.com',
headers: {
Authorization: `Basic ${btoa('username:password')}`,
},
});
// Use the client to make API calls
async function main() {
const { data } = await getProductsPage({
client,
query: { nestedFields: "catalog" },
});
for (const product of data?.items ?? []) {
console.log(product);
}
}
The library supports custom client implementations for different authentication methods and HTTP clients. Check out the examples directory for complete implementations.
Ky Client (ky.auth.client.ts
)
Basic Authentication (basic.auth.client.ts
)
Liferay Fetch (liferay-fetch.auth.client.ts
)
The library provides access to various Liferay services through different client modules:
analytics-cms-rest-v1.0
- CMS Analyticsanalytics-reports-rest-v1.0
- Analytics Reportsanalytics-settings-rest-v1.0
- Analytics Settingsheadless-commerce-admin-catalog-v1.0
- Product catalog managementheadless-commerce-admin-channel-v1.0
- Channel managementheadless-commerce-admin-inventory-v1.0
- Inventory managementheadless-commerce-admin-order-v1.0
- Order managementheadless-commerce-admin-payment-v1.0
- Payment processingheadless-commerce-admin-pricing-v1.0
- Pricing managementheadless-commerce-delivery-cart-v1.0
- Shopping cart operationsheadless-commerce-delivery-catalog-v1.0
- Product catalog deliveryheadless-admin-content-v1.0
- Content managementheadless-asset-library-v1.0
- Asset library managementheadless-delivery-v1.0
- Content deliveryheadless-admin-site-v1.0
- Site managementheadless-site-v1.0
- Site operationsheadless-admin-address-v1.0
- Address managementheadless-admin-user-v1.0
- User managementheadless-admin-taxonomy-v1.0
- Taxonomy managementheadless-form-v1.0
- Form managementheadless-object-v1.0
- Object managementnotification-v1.0
- Notification systemsearch-v1.0
- Search functionalityThis library is built with TypeScript and provides full type safety for all API operations. All request and response types are automatically generated from the OpenAPI specifications.
This library is built using the following key technologies:
@hey-api/client-fetch
- For making HTTP requests@hey-api/openapi-ts
- For TypeScript type generationThis is a community-driven project. Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
MIT License - See LICENSE.md for details.
FAQs
A collection of Headless Clients used in Liferay Portal
We found that liferay-headless-rest-client 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.