Plugin configuration
Configure plugins using nocto-config.
Plugins section
Nocto lets you also configure every plugin, if a plugin exposes parameters to configure. This is done via plugins section in nocto-config.ts
.
import { NoctoConfig } from "@rsc-labs/noctojs-plugin-system"
import {
Sparkles,
} from "@medusajs/icons"
export const noctoConfig: NoctoConfig = {
plugins: {
"@login": {
config: {
title: "Welcome to Nocto",
hint: "Sign in to access",
mainIcon: Sparkles
}
},
"@orders": {},
"@order-detail": {},
"@campaigns-routes": {},
"@categories-routes": {},
"@collections-routes": {},
"@core-routes": {},
"@customer-groups-routes": {},
"@public-routes": {},
"@reservations-routes": {},
"@settings-routes": {}
},
sidebar: {
"@orders": { order: 1 },
"@products": { order: 2 },
"@inventory": { order: 3 },
"@customers": { order: 4 },
"@promotions": { order: 5 },
"@price-lists": { order: 6 },
}
}
In above example, @login
plugin exposes three configurable parameters - title
, hint
and mainIcon
. You can configure them using a config
object.
At this moment there is no single place where you can find all configuration parameters - they need to be revealed while analyzing the code, but it will be improved in the future.
Parameter or Slot:
In theory, instead of exposing configuration, plugin can expose a slot. However, exposing parameters is the lightweight approach if only very small part of UI needs to be changed.