npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

liferay-headless-rest-client

v3.0.0

Published

A collection of Headless Clients used in Liferay Portal

Readme

Liferay Headless REST Client

⚠️ 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.

Liferay Version Compatibility

This library is designed to work with Liferay Portal 2025 Q3 and above. The API endpoints and types are generated from Liferay's OpenAPI specifications for these versions.

Installation

npm install liferay-headless-rest-client
# or
yarn add liferay-headless-rest-client
# or
bun add liferay-headless-rest-client

Quick Start

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);
    }
}

Custom Client Examples

The library supports custom client implementations for different authentication methods and HTTP clients. Check out the examples directory for complete implementations.

Available Examples

  1. Ky Client (ky.auth.client.ts)

    • Implements OAuth2 authentication
    • Includes retry mechanism
    • Uses the Ky HTTP client for requests
  2. Basic Authentication (basic.auth.client.ts)

    • Simple Basic Auth implementation
    • Uses username/password authentication
  3. Liferay Fetch (liferay-fetch.auth.client.ts)

    • Inherits fetch from Portal
    • Client-side only implementation
    • Useful for browser-based applications

Available Clients

The library provides access to various Liferay services through different client modules:

Analytics

  • analytics-cms-rest-v1.0 - CMS Analytics
  • analytics-reports-rest-v1.0 - Analytics Reports
  • analytics-settings-rest-v1.0 - Analytics Settings

Commerce Clients

  • headless-commerce-admin-catalog-v1.0 - Product catalog management
  • headless-commerce-admin-channel-v1.0 - Channel management
  • headless-commerce-admin-inventory-v1.0 - Inventory management
  • headless-commerce-admin-order-v1.0 - Order management
  • headless-commerce-admin-payment-v1.0 - Payment processing
  • headless-commerce-admin-pricing-v1.0 - Pricing management
  • headless-commerce-delivery-cart-v1.0 - Shopping cart operations
  • headless-commerce-delivery-catalog-v1.0 - Product catalog delivery

Content Management

  • headless-admin-content-v1.0 - Content management
  • headless-asset-library-v1.0 - Asset library management
  • headless-delivery-v1.0 - Content delivery

Site Management

  • headless-admin-site-v1.0 - Site management
  • headless-site-v1.0 - Site operations

User Management

  • headless-admin-address-v1.0 - Address management
  • headless-admin-user-v1.0 - User management

Other Services

  • headless-admin-taxonomy-v1.0 - Taxonomy management
  • headless-form-v1.0 - Form management
  • headless-object-v1.0 - Object management
  • notification-v1.0 - Notification system
  • search-v1.0 - Search functionality

Type Safety

This 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.

Tools and Technologies

This library is built using the following key technologies:

  • HeyAPI - Used for generating type-safe API clients from OpenAPI specifications
    • @hey-api/client-fetch - For making HTTP requests
    • @hey-api/openapi-ts - For TypeScript type generation
  • Biome - For code formatting and linting
  • Bun - JavaScript runtime and build tool

Contributing

This 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.

License

MIT License - See LICENSE.md for details.