hps-plugin-hub-verdaccio
By Hyperse
hps-plugin-hub-verdaccio is a Hub Verdaccio plugin in the Hub Core group.hps-plugin-hub-verdaccio provides Hub Verdaccio 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-verdaccio
Support languages
TypeScript, JavaScript, HTML, CSS, Prolog, Shell
Last published
July 16, 2026
@hyperse-hub/hps-plugin-hub-verdaccio
Vendure plugin that bridges a Verdaccio (or compatible) private registry with Hyperse Hub licensing: per-customer registry accounts, encrypted Shop API hooks for Verdaccio auth plugins, package access checks via @hyperse-hub/hps-plugin-hub, and download telemetry.
Requirements
- Node.js ≥ 20
- Vendure ^3.5 (plugin declares compatibility
>=3.0.0)
@hyperse-hub/hps-plugin-hub registered before this plugin (shared cipherKey and HubLicensePackageService)
- Peer deps aligned with
@vendure/core, NestJS GraphQL, TypeORM (see package.json)
Install
yarn add @hyperse-hub/hps-plugin-hub @hyperse-hub/hps-plugin-hub-verdaccio
Register in VendureConfig
Use the same 64-character hexadecimal cipherKey as HpsPluginHub.init() (32 random bytes). HpsPluginHubVerdaccio.init() forwards it to HpsPluginHub.init() so encryption matches across license checks and Verdaccio payloads.
If you omit cipherKey, the plugin uses a built-in development key and logs a warning. Override with randomBytes(32).toString('hex') in production.
Configuration
| Option | Required | Description |
|---|
cipherKey | Yes* | 64-char hex string; must match HpsPluginHub. *Default dev key if omitted. |
allowPublishUserGroups | No | Customer group names allowed to publish (default ['allow_publish']). |
allowUnPublishUserGroups | No | Customer group names allowed to unpublish (default ['allow_unpublish']). |
On bootstrap, the plugin ensures customer groups named in those arrays exist (creates them if missing).
Data model
| Entity | Table | Purpose |
|---|
HubVerdaccioAuth | hub_verdaccio_auth | Registry username/password per customer (username unique). |
HubVerdaccioDownload | hub_verdaccio_download | Tarball download events (packageName, packageVersion, customerId). |
Passwords are stored as provided (plain text in DB); treat Admin API and database access accordingly.
Permissions (Admin API)
hubVerdaccioPermission (CrudPermissionDefinition('HubVerdaccio')) registers:
CreateHubVerdaccio, ReadHubVerdaccio, UpdateHubVerdaccio, DeleteHubVerdaccio
Assign on administrator roles as needed.
Admin GraphQL (summary)
Auth
- Queries:
hubVerdaccioAuths, hubVerdaccioAuth(id)
- Mutations:
createHubVerdaccioAuth, updateHubVerdaccioAuth
deleteHubVerdaccioAuth(id) sets enabled: false (soft disable), not a hard row delete.
Downloads
- Queries:
hubVerdaccioDownloads, hubVerdaccioDownload(id)
- Mutation:
deleteHubVerdaccioDownload(id) (hard delete)
Customer.weeklyDownloads (also on Admin API): count of HubVerdaccioDownload rows for that customer with createdAt within the last 7 days (rolling window).
Schema details live under src/api/.
Shop API
Authenticated customers
registryInfo — Permission.Authenticated. Returns { username, password } for the current user’s linked customer; if no HubVerdaccioAuth exists, one is created with a generated username/password.
Customer.weeklyDownloads — Same rolling 7-day count as Admin.
Verdaccio integration (encrypted payloads)
Mutations , , , , , take an encrypted string (and package args where applicable). The server decrypts JSON with the plugin using ( / ), same family as Hub license payloads.
statsTarballDownload(downloadEncryptMeta: String!) — Decrypts metadata (username, packageName, packageVersion); records a download if the user exists and HubLicensePackageService.userCanAccessPackage allows the package.
Wire these from your Verdaccio auth / storage plugin so the registry calls your Shop GraphQL endpoint.
Events
HubVerdaccioAuthEvent — created | updated | deleted on HubVerdaccioAuth.
HubVerdaccioDownloadEvent — created | deleted on HubVerdaccioDownload.
See src/events/.
Source layout (src/)
| Path | Role |
|---|
api/ | GraphQL schema extensions (admin + shop) |
config/ | hubVerdaccioPermission |
entities/ | TypeORM entities |
events/ | Domain events |
resolvers/ | Admin, shop, and Customer field resolvers |
services/ | Auth, download, license integration |
utils/ | tryDecryptJson helper |
types.ts | PluginInitOptions |
Package exports
The package entry (src/index.ts) re-exports the plugin class, services, and events. Import HpsPluginHubVerdaccio from @hyperse-hub/hps-plugin-hub-verdaccio.
Scripts (monorepo / package)
| Script | Purpose |
|---|
yarn build | Compile to dist/ |
yarn serve | Dev Vendure (HpsPluginHub + this plugin) |
yarn test | Unit + e2e (Vitest) |
yarn codegen | GraphQL codegen (admin/shop types) |
@hyperse-hub/hps-plugin-hub — License packages and access checks used by this plugin.
@hyperse-hub/hps-plugin-hub-client — Client utilities for hub/registry flows where applicable.
import type { VendureConfig } from '@vendure/core';
import { HpsPluginHub } from '@hyperse-hub/hps-plugin-hub';
import { HpsPluginHubVerdaccio } from '@hyperse-hub/hps-plugin-hub-verdaccio';
import { randomBytes } from 'node:crypto';
const cipherKey = randomBytes(32).toString('hex');
export const config: VendureConfig = {
plugins: [
HpsPluginHub.init({ cipherKey }),
HpsPluginHubVerdaccio.init({
cipherKey,
allowPublishUserGroups: ['allow_publish'],
allowUnPublishUserGroups: ['allow_unpublish'],
}),
],
};
verdaccioAuthenticate
verdaccioAdduser
verdaccioChangePassword
verdaccioAllowAccess
verdaccioAllowPublish
verdaccioAllowUnpublish
auth
cipherKey
@hyperse-hub/hps-common
encrypt
decrypt
constants.ts | Logger context, dev cipher default, DI token |