npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@haus-tech/haus-storefront-companion

v3.6.1

Published

Haus storefront companion plugin

Readme


name: haus-storefront-companion title: Haus Storefront Companion Plugin description: Vendure plugin that exposes custom field definitions to the Admin and Shop APIs so storefronts can render custom fields dynamically. version: 3.6.0 tags: [vendure, plugin, custom-fields, storefront, graphql]

Haus Storefront Companion Plugin

The Haus Storefront Companion Plugin exposes the running Vendure instance's custom field definitions (not just their values) through the Admin and Shop GraphQL APIs. This lets a storefront discover, at runtime, which custom fields exist on each entity — their names, types, and metadata — so it can render forms and display custom data dynamically instead of hard-coding field lists.

Functionality

  • getCustomFieldsForEntity(entityName) — Returns the custom field configuration for a single entity (e.g. Product, Order, Customer).
  • getAllCustomFields — Returns the custom field configuration for every entity that has custom fields, sorted by entity name.
  • API-aware visibility — On the Shop API, only fields marked public and not internal are returned. The Admin API returns all fields.
  • Both APIs — The same two queries are available on the Admin and Shop APIs.

Use Cases

  • Render custom-field-driven UI in a headless storefront without hard-coding the field list.
  • Build a generic admin/editor UI that adapts to whatever custom fields are configured on the Vendure server.
  • Introspect custom field metadata (type, label, options) at runtime.

Installation

  1. Install the plugin package:

    yarn add @haus-tech/haus-storefront-companion

    Or, if using npm:

    npm install @haus-tech/haus-storefront-companion
  2. Add the plugin to your Vendure configuration in vendure-config.ts:

    import { HausStorefrontCompanionPlugin } from '@haus-tech/haus-storefront-companion'
    
    export const config = {
      plugins: [HausStorefrontCompanionPlugin.init({})],
    }
  3. Restart your Vendure server.

Usage

Get custom fields for a single entity

query {
  getCustomFieldsForEntity(entityName: Product)
}

Get all custom fields grouped by entity

query {
  getAllCustomFields {
    entityName
    customFields
  }
}

customFields is returned as JSON, matching Vendure's CustomFieldConfig shape (name, type, label, list, public, internal, etc.).

The queries are available on both the Admin API and the Shop API. On the Shop API only fields marked public and not internal are returned.

Testing

  1. Run yarn test to execute the tests.
  2. Implement additional tests to cover your specific use cases.

Publish to NPM

  1. Make sure you are logged in to NPM.

  2. Build the plugin:

    yarn build
  3. Publish the plugin (releases are managed via Nx Release from the repo root):

    npx nx release

Resources