Hyperse
  • Pricing
  • FAQs
Newsletter

Subscribe to our newsletter

Receive weekly updates with latest collections and exclusive offers, straight to your inbox.

Hyperse

Headless commerce solutions for brands, developers, and modern ecommerce teams.

Explore

  • Home
  • About Us
  • Partners
  • FAQs

Legal & resources

  • Proposal
  • Privacy Policy
  • Terms & Conditions

© 2026 Hyperse. All rights reserved.


  1. Home
  2. Vendure Plugins
  3. hps-plugin-hub-client
hps-plugin-hub-client

hps-plugin-hub-client

By Hyperse

hps-plugin-hub-client is a Hub Client plugin in the Hub Core group.hps-plugin-hub-client provides Hub Client plugin capabilities for Hub Core. Core platform infrastructure and extension runtime. It is especially useful for core workflows.

CoreVendure Plugins

Specifications

Technical details and package information for this product.

Package

@hyperse-hub/hps-plugin-hub-client

Support by

Hyperse

Support languages

TypeScript, JavaScript, HTML, CSS, Prolog, Shell

Integration type

Core

Category

Vendure Plugins

Compatible with

^3.0.0

Latest version

1.1.6

Downloads

0

Repository

ssh://git@github.com/hyperse-hub/hub-core

Last published

July 14, 2026

Description
Changelog
loading...

@hyperse-hub/hps-plugin-hub-client

Vendure plugin that registers LicenseService for validating commercial / licensed npm-style packages against remote HTTP endpoints. It encrypts { licenseKey, packageName } with a shared cipherKey (same contract as @hyperse-hub/hps-plugin-hub’s POST /license/check) and tries each configured URL until one returns { valid: true } or all fail.

Pair this package with a running Hyperse Hub (@hyperse-hub/hps-plugin-hub) or any compatible license API that accepts the encrypted body and responds with { valid: boolean, message?: string }.

Requirements

  • Node.js ≥ 20
  • Vendure ^3.5 (plugin declares compatibility >=3.0.0)
  • Peers: @nestjs/common, @vendure/core (see package.json)

Install

yarn add @hyperse-hub/hps-plugin-hub-client

Register in VendureConfig

cipherKey must be exactly 64 hexadecimal characters (32 bytes). It must match the key on the license server that decrypts the request (see @hyperse-hub/hps-common encrypt / decrypt).

Default merged options (before init) use licenseCheckEndpoints: ['https://oss.hyperse.net/license/check'] and an empty cipherKey; init must supply a valid key or LicenseService construction will throw.

Configuration (HpsPluginHubClient.init)

OptionRequiredDescription
cipherKeyYes64-char hex string (randomBytes(32).toString('hex')). Same as Hub’s license check crypto.
licenseCheckEndpointsYes*URLs tried in order until valid: true or all fail. Default list includes Hyperse OSS endpoint; override for self-hosted Hub.
licenseCheckRequestTimeoutMsNoPer-request timeout (default 30000 ms).

*If you omit licenseCheckEndpoints in init, previously merged defaults apply; pass [] only if you intentionally disable remote checks (e.g. tests).

Using LicenseService

Inject LicenseService in your plugin or service, then call checkLicenseKey(licenseKey, packageName) where packageName is the npm package name your license is bound to (e.g. @hyperse-hub/hps-plugin-storage).

checkLicenseKey returns Promise<LicenseKeyCheckResult>: { valid: boolean; message: string }. On network or parse errors it logs and returns { valid: false, message: ... }.

Wire format (compatible Hub)

The client POSTs JSON { "data": "<encrypted payload>" }. Decrypted payload is JSON { "licenseKey", "packageName" }. The remote response must include a boolean valid; optional message is surfaced in logs and in LicenseKeyCheckResult.message.

See @hyperse-hub/hps-plugin-hub README section REST: POST /license/check for the full server contract.

Package exports

Public entry (@hyperse-hub/hps-plugin-hub-client) exports:

  • HpsPluginHubClient — Vendure plugin class; use HpsPluginHubClient.init(...).
  • LicenseService — Injectable service with checkLicenseKey.
  • Types: PluginInitOptions, LicenseKeyCheckResult, RemoteLicenseCheckResponse.
  • Constants: loggerCtx, PLUGIN_INIT_OPTIONS (Nest DI token for merged options).

Scripts (package)

ScriptPurpose
yarn buildCompile dist/
yarn testUnit + e2e
yarn lintESLint

Related packages

  • @hyperse-hub/hps-plugin-hub — Server-side licenses, admin CRUD, and POST /license/check.
  • @hyperse-hub/hps-plugin-hub-verdaccio — Registry-side flows (see its README).

On this page

  • @hyperse-hub/hps-plugin-hub-client
    • Requirements
    • Install
    • Register in VendureConfig
    • Configuration (HpsPluginHubClient.init)
    • Using LicenseService
    • Wire format (compatible Hub)
    • Package exports
    • Scripts (package)
    • Related packages

import type { VendureConfig } from '@vendure/core';
import { HpsPluginHubClient } from '@hyperse-hub/hps-plugin-hub-client';
import { randomBytes } from 'node:crypto';
export const config: VendureConfig = {
plugins: [
HpsPluginHubClient.init({
cipherKey:
process.env.HUB_LICENSE_CIPHER_KEY ?? randomBytes(32).toString('hex'),
licenseCheckEndpoints: ['https://your-hub.example.com/license/check'],
}),
],
};
import { Injectable, OnApplicationBootstrap } from '@nestjs/common';
import { Logger } from '@vendure/core';
import { LicenseService } from '@hyperse-hub/hps-plugin-hub-client';
const loggerCtx = 'YourPlugin';
@Injectable()
export class YourPluginService implements OnApplicationBootstrap {
constructor(private licenseService: LicenseService) {}
async onApplicationBootstrap(): Promise<void> {
const licenseKey = process.env.YOUR_PLUGIN_LICENSE_KEY;
if (!licenseKey) {
Logger.warn('No license key configured', loggerCtx);
return;
}
const result = await this.licenseService.checkLicenseKey(
licenseKey,
'@hyperse-hub/your-licensed-package'
);
if (!result.valid) {
Logger.error(
`License invalid or check failed: ${result.message}`,
loggerCtx
);
// e.g. set a flag and degrade features
return;
}
Logger.info('License check passed', loggerCtx);
}
}