Reference
A listing of the niyase-plugin CLI, the useNiyase() bridge, types, and helpers.
A listing of the public API of @niyase/plugin-sdk that is confirmed as of today. The SDK is still under active development, so this page will keep growing.
CLI (niyase-plugin)
| Command | Description |
|---|---|
new | Scaffold from @scope/name |
build | Generate the IIFE bundle (--entry / --out / --minify) |
lint | tsc + validateManifest() + forbidden-API scan |
test | Run vitest |
dev | Local preview (--port) |
publish | Build + validate + submit (--dry-run / --token / --registry) |
The useNiyase() bridge
data / core / connections / context / i18n / navigate / toast / palette.
connections is exclusive to PROVIDER-CLIENT plugins; calling it from a standalone plugin returns a CONNECTION_NOT_FOUND-style error.
For details, see UI Integration and Core API Integration.
import { createNiyase, useNiyase, register } from "@niyase/plugin-sdk";
// In the entry: createNiyase(); register("@scope/name", Root);
// Anywhere: const niyase = useNiyase();
Manifest (@niyase/plugin-sdk/manifest)
import {
defineManifest,
validateManifest,
parseManifestOrThrow,
type PluginManifest,
} from "@niyase/plugin-sdk/manifest";
defineManifest(m): a typed identity (for completion)validateManifest(input):{ ok: true, manifest } | { ok: false, errors }(zod, the same validationniyase-plugin lintuses)parseManifestOrThrow(input): throws on validation failure instead of returning a result
See Manifest for details on each field.
Types
Manifest-related (@niyase/plugin-sdk/manifest): PluginManifest / PluginAudience / PluginTableDef (each table must declare a resource; rowScope is optional) / PluginColumnDef (masked for column masking) / PluginPaletteMetadata / PluginScope / PluginVisibility / Industry / IntentCategory.
PluginIndustryPreset/PluginI18nTermsstill exist as types for backward compatibility, but the industry-preset mechanism itself has been discontinued (see the classification axes in Getting Started). Don't use them in new plugins.
Bridge-related (@niyase/plugin-sdk): NiyaseBridge / NiyaseContextValue / NiyaseDataClient / NiyaseCoreClient / NiyaseConnectionsClient / NiyaseErrorCode.
Other exports (@niyase/plugin-sdk)
| Export | Use |
|---|---|
pluginTableName(pluginId, table) | Helper that computes the physical table name (plg_<scope>_<name>_<table>) |
pluginTablePrefix(pluginId) | Helper that computes a plugin's table prefix (plg_<scope>_<name>) |
ManifestApp / MANIFEST_APP_CSS | Component that renders a generic list + form CRUD UI from a declarative config |
Test helpers (@niyase/plugin-sdk/host)
createTestHost({ manifest, context }): returns a headless bridge connected to the MOCK backendrunBridgeConformance(bridge): a minimal conformance check of the bridge contract (verifies REAL/MOCK behavior parity)
import { createTestHost } from "@niyase/plugin-sdk/host";
const { niyase } = createTestHost({ manifest, context });
await niyase.ready;
const res = await niyase.data.list("task");
Examples
The best reference is your own scaffold running in local preview (niyase-plugin dev).
The official plugin @niyase/todos (the minimal SDK/bundle reference implementation) is also a useful reference.