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
hps-plugin-hub

hps-plugin-hub

By Hyperse

hps-plugin-hub is a Hub plugin in the Hub Core group.hps-plugin-hub provides Hub 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

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

Downloads

0

Repository

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

Last published

July 16, 2026

Description
Changelog
loading...

@hyperse-hub/hps-plugin-hub

Vendure plugin for private npm-style license packages: persist licenses per customer and product, expose admin CRUD, a shop-facing list without license keys, and a REST license check that accepts an encrypted payload.

Requirements

  • Node.js ≥ 20
  • Vendure ^3.5 (plugin declares compatibility >=3.0.0)
  • Peer deps align with @vendure/core, NestJS GraphQL, TypeORM (see package.json)

Install

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

Register in VendureConfig

cipherKey must be exactly 64 hexadecimal characters (32 random bytes). Use the same key anywhere you encrypt payloads for POST /license/check (see @hyperse-hub/hps-common).

import type { VendureConfig } from '@vendure/core'; import { HpsPluginHub } from '@hyperse-hub/hps-plugin-hub'; import { randomBytes } from 'node:crypto'; export const config: VendureConfig = { // ... plugins: [ HpsPluginHub.init({ cipherKey: randomBytes(32).toString('hex'), }), ], };

Configuration

OptionRequiredDescription
cipherKeyYes64-char hex string (randomBytes(32).toString('hex')). Invalid values throw at init().

Local dev server

This package includes yarn serve, which loads config/.env when present. You can set:

  • HUB_LICENSE_CIPHER_KEY — 64 hex chars; otherwise config/dev-server.ts uses a fixed fallback key (development only).

Data model: HubLicensePackage

Stored as table hub_license_package with a unique (customerId, packageName) pair.

FieldNotes
packageNamePackage name as in the registry (e.g. Verdaccio scope).
licenseKeySecret; not exposed on Shop API types.
accessibleEndsAtOptional end of access; null treated as no end date.
customer / productVendure relations.

Permissions (Admin API)

The plugin registers hubPermission (CrudPermissionDefinition('HpsPluginHub')). Assign on administrator roles:

  • CreateHpsPluginHub, ReadHpsPluginHub, UpdateHpsPluginHub, DeleteHpsPluginHub

Admin queries and mutations are gated by these permissions.

Admin GraphQL (summary)

  • Queries: hubLicensePackages, hubLicensePackage(id)
  • Mutations: createHubLicensePackage, updateHubLicensePackage, deleteHubLicensePackage

CreateHubLicensePackageInput / UpdateHubLicensePackageInput include packageName, optional licenseKey, optional accessibleEndsAt, customerId, productId (see schema in src/api/).

Shop API

All shop responses use HubLicensePackageShop, which omits licenseKey. Distribute keys only via Admin API or other secure channels.

  • hubLicenses — Paginated licenses for the authenticated customer.
  • Customer.activeLicenses — Count of licenses that pass the same validity rules as server-side checks (including accessibleEndsAt when set).
  • Customer.nextRenewals — Licenses that are already expired (accessibleEndsAt before now) and are candidates for renewal.

Example shape:

query ShopHubLicenses { hubLicenses { items { id packageName accessibleEndsAt product { id name } } totalItems } }

REST: POST /license/check

Body:

{ "data": "<encrypted string>" }

After decryption, the payload must be JSON with licenseKey and packageName (both strings). Encryption must use the plugin’s cipherKey via @hyperse-hub/hps-common (encrypt / decrypt).

Responses (JSON):

  • Success path: { "valid": true, "message": "License key is valid" }
  • Invalid / missing / expired: { "valid": false, "message": "<reason>" }
  • Malformed body or crypto: 400 with a generic bad-request message.

Typical reasons for valid: false: unknown key, or license expired per accessibleEndsAt.

Events

HubLicensePackageEvent is emitted when a HubLicensePackage is created, updated, or deleted (see src/events/).

Package exports

The public entry re-exports the plugin, hubPermission, services, types, and events (src/index.ts). Use these for custom integrations or tests.

Scripts (monorepo / package)

ScriptPurpose
yarn buildCompile to dist/
yarn serveDev Vendure with this plugin
yarn testUnit + e2e (Vitest)
yarn codegenGraphQL codegen (admin/shop)

Related packages

In this monorepo, hub tooling may also use @hyperse-hub/hps-plugin-hub-client and @hyperse-hub/hps-plugin-hub-verdaccio for registry-side flows; see their READMEs for wiring details.

On this page

  • @hyperse-hub/hps-plugin-hub
    • Requirements
    • Install
    • Register in VendureConfig
    • Configuration
      • Local dev server
    • Data model: HubLicensePackage
    • Permissions (Admin API)
      • Admin GraphQL (summary)
    • Shop API
    • REST: POST /license/check
    • Events
    • Package exports
    • Scripts (monorepo / package)
    • Related packages