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-risk-control
hps-plugin-risk-control

hps-plugin-risk-control

By Yingchun Tian

hps-plugin-risk-control is a Risk Control plugin in the Hub Support group.hps-plugin-risk-control provides Risk Control plugin capabilities for Hub Support. Customer support, service operations, and risk handling tools. It is especially useful for support workflows.

CoreVendure Plugins

Specifications

Technical details and package information for this product.

Package

@hyperse-hub/hps-plugin-risk-control

Support by

Yingchun Tian

Support languages

TypeScript, JavaScript, CSS, Prolog, Shell

Integration type

Core

Category

Vendure Plugins

Compatible with

^3.0.0

Latest version

1.0.10

Downloads

0

Repository

https://github.com/hyperse-hub/hub-support

Last published

July 14, 2026

Description
Changelog
loading...

@hyperse-hub/hps-plugin-risk-control

Vendure plugin that persists and queries risk signals (RiskSignal) through the Admin API. Each row is an auditable fact or decision—e.g. address clustering anomalies, same email across accounts, high cancellations/refunds, manual review—so rules, operations tooling, and LLM-based risk workflows can share one source of truth.

Features

  • Signal-oriented model: Multiple rows per email or customer; keeps a timeline and evidence.
  • Category and source: RiskSignalCategory / RiskSignalSource (GraphQL enums align with the database).
  • Structured + narrative: evidence (JSON for rules/dashboards), llmContext (JSON for prompts).
  • Relations: Optional Customer and Order; emailNormalized joins mailboxes across accounts.
  • Admin GraphQL: Paginated list, get-by-id, and a union context query (riskSignalsForContext) over customer / email / order.
  • Dashboard menu: Registers a Hyperse Admin entry at /risk-control (UI lives under ui/ in this package).

Installation

Register the plugin in your Vendure config:

The risk_signal table is created when the schema is synchronized the first time.

Data model (high level)

Field (subset)Description
emailNormalized / emailDisplayNormalized mailbox and optional original casing for display
addressText / addressFingerprintRaw address and a stable fingerprint from your pipeline (hash, geohash, etc.)
category / sourceWhy the signal exists and how it was produced
riskScore0–100; semantics are defined by your integration
reasonSummary / detailShort label and longer explanation
evidence / llmContextArbitrary JSON payloads
customerId /

On create, the server requires at least one anchor: email, customerId, orderId, or addressFingerprint.

Admin GraphQL (summary)

Field-level descriptions live in src/api/common/risk.type.ts and src/api/admin-api/risk.api.ts.

OperationDescription
riskSignal(id)Fetch one signal
riskSignals(options)Paginated list (RiskSignalListOptions: filters/sort generated for the entity)
riskSignalsForContext(input)Union over customerId or email or orderId; ordered by createdAt desc; take defaults to 100, max 500
createRiskSignal / updateRiskSignal / deleteRiskSignalMutations; delete is a hard delete—pair with retention policy and tight roles in production

Permissions

Defaults: ReadCustomer for reads, UpdateCustomer for writes. Swap in custom permissions or gateway rules if you need separation from general CS roles.

LLM / rules integration

  1. Write: On rule hits, call createRiskSignal; put countable facts in evidence (e.g. refunds in a window, linked account ids) and a short narrative or bullet object in llmContext.
  2. Read: Before checkout or in agent UIs, call riskSignalsForContext and feed detail, evidence, and llmContext (within the capped list) into your prompt.
  3. Idempotency: Use externalRef; add a DB unique constraint if needed (e.g. on (source, externalRef)).

Development

Package exports

The public entry exports include HpsPluginRiskControl, RiskSignal, RiskSignalCategory, RiskSignalSource, RiskSignalService, and normalizeEmail for use from other plugins or jobs.

License

MIT (see repository LICENSE).

On this page

  • @hyperse-hub/hps-plugin-risk-control
    • Features
    • Installation
    • Data model (high level)
    • Admin GraphQL (summary)
      • Permissions
    • LLM / rules integration
    • Development
    • Package exports
    • License

import { HpsPluginRiskControl } from '@hyperse-hub/hps-plugin-risk-control';
const config: VendureConfig = {
plugins: [
HpsPluginRiskControl.init({
// See src/types.ts — RiskControlPluginOptions can be extended
}),
],
};
orderId
Optional foreign keys
externalRefCorrelation / idempotency key from rules jobs or vendors
yarn install
yarn serve # Local Vendure + Admin
yarn codegen # Requires reachable admin-api; refreshes src/generated-admin-types.ts
yarn typecheck
yarn build:server
yarn test-unit
yarn test-e2e