hps-plugin-public-customer-groups
By Yingchun Tian
hps-plugin-public-customer-groups is a Public Customer Groups plugin in the Hub Store group.hps-plugin-public-customer-groups provides Public Customer Groups plugin capabilities for Hub Store. Storefront commerce features for shopping and orders.
CoreVendure Plugins
Specifications
Technical details and package information for this product.
Package
@hyperse-hub/hps-plugin-public-customer-groups
Support languages
TypeScript, JavaScript, CSS, Prolog, Shell
Last published
July 14, 2026
@hyperse-hub/hps-plugin-public-customer-groups
Vendure plugin that exposes customer group membership on the Shop API in a privacy-conscious way: only groups explicitly marked “public” are listed on the authenticated customer, and the member list on each group is always empty in the shop schema so other customers’ data cannot be scraped.
Part of the Hub Store monorepo — see Platform.md.
What it does
| Area | Behavior |
|---|
| Admin | Adds a boolean custom field CustomerGroup.customFields.isPublic. You assign customers to groups as usual; toggle isPublic for groups that are safe to surface on the storefront (e.g. loyalty tier labels). |
Shop – Customer.customerGroups | New field listing groups the current customer belongs to after filtering to isPublic === true. Groups with a missing or false flag are omitted. |
Shop – CustomerGroup.customers | Resolved to an always-empty paginated connection so the default Vendure shop exposure of group members is neutralized. |
The isPublic flag uses public: false in custom-field config so it is not part of the generated Shop GraphQL type for CustomerGroup. The storefront does not get a direct isPublic argument or field on group objects from schema introspection; the server still reads the stored value when building customerGroups.
Installation
Development
From this package directory:
Shop GraphQL example
After a customer signs in, you can load public groups only:
Use Admin API mutations/queries to create groups, set customFields.isPublic, and assign customers.
Security notes
- Default is private: If
isPublic is unset or false, the group does not appear under customerGroups in the shop.
- Peer listing disabled: Do not rely on
CustomerGroup.customers in the Shop API for real data; it is intentionally empty for privacy.
- Admin vs shop: Managing groups and the
isPublic flag remains an admin concern; the shop only sees filtered membership.
License
MIT — see the repository root.
import { VendureConfig } from '@vendure/core';
import { HpsPluginPublicCustomerGroups } from '@hyperse-hub/hps-plugin-public-customer-groups';
export const config: VendureConfig = {
plugins: [
HpsPluginPublicCustomerGroups,
],
};
yarn serve
yarn build
yarn lint
yarn typecheck
yarn test
query ActiveCustomerPublicGroups {
activeCustomer {
id
customerGroups {
id
name
customers {
totalItems
}
}
}
}