@flexiweb/business
v3.66.0
Published
Business plugin for Flexiweb Powered by PayloadCMS v3. It adds customers collection, business settings, business document types and documents collections.
Maintainers
Readme
@flexiweb/business
Business plugin for the Flexiweb ecosystem — PayloadCMS v3 plugin providing customers, documents, document types and business settings.
Quick Links: License • Documentation • Website
Overview
@flexiweb/business is a lightweight, focused plugin for PayloadCMS v3 that adds business-oriented data structures to the Flexiweb ecosystem. It registers sensible, ready-to-use collections and globals that cover common business scenarios:
- Customers collection
- Customer document types & documents collections
- Business document types & documents collections
- Business settings (global)
The plugin can be fully customized via overrides and is intended to be used alongside @flexiweb/core (the core plugin for shared fields/utilities).
Key features
- Pre-configured, production-friendly collections for business data
- Global business settings configuration
- Document type / document modelling for customers and businesses
- Override hooks and extension points for every collection or global
- Built-in translations merged into the host app i18n
Installation
Install the package with your package manager of choice:
# pnpm (recommended)
pnpm add @flexiweb/business
# npm
npm install @flexiweb/business
# yarn
yarn add @flexiweb/businessPeer dependency: this plugin requires @flexiweb/core to be present in your project and be enabled in your payload config.
Usage
Add the plugin to your Payload config. The plugin exposes a factory function flexiwebBusinessPlugin(options?: BusinessPluginConfig).
import { flexiwebBusinessPlugin } from '@flexiweb/business'
import { buildConfig } from 'payload'
export default buildConfig({
plugins: [
flexiwebBusinessPlugin({
// optional options: disabled, overrides, etc.
}),
],
})When used, the plugin will add its collections and global to your buildConfig automatically.
Configuration (options)
The plugin accepts a BusinessPluginConfig object:
disabled?: boolean— disable plugin behavior entirelyoverrides?: { ... }— granular overrides for each collection/global so you can add fields, override field configs, or replace collection/global settings
Type definitions are exposed via ./types (import BusinessPluginConfig from @flexiweb/business/types).
Example: add an extra field to the customers collection
flexiwebBusinessPlugin({
overrides: {
customers: {
additionalFields: [
{ name: 'customerCode', type: 'text', label: { en: 'Customer code' } },
],
},
},
})Exports
Useful exports include:
flexiwebBusinessPlugin— main plugin factory./types— plugin configuration and override types./utils— helper utilities./constants— shared constants./validations— validation helpers./translations— built-in translations
You can import individual pieces by using the package subpath exports (see package.json exports).
Development
This repository contains a dev/ application and example collections that make it easy to preview and iterate on the plugin locally.
Common commands:
pnpm install
pnpm build
pnpm dev # run the dev app in ./dev
pnpm testContributing
We welcome issues, suggestions and documentation improvements. If you plan a code contribution, please open an issue first so we can coordinate.
License
See LICENSE.md for the project's license and commercial usage conditions.
Built with ❤️ for the PayloadCMS community — Website • GitHub
