Developer docs
Reference·

Reference

A listing of the niyase-plugin CLI, the useNiyase() bridge, types, and helpers.

A listing of the public API of @niyase/plugin-sdk.

CLI (niyase-plugin)

CommandDescription
newScaffold from @scope/name
buildGenerate the IIFE bundle (--entry / --out / --minify)
linttsc + validateManifest() + forbidden-API scan
testRun vitest
devLocal preview (--port)
publishBuild + validate + submit (--dry-run / --token)

The useNiyase() bridge

data / core / context / i18n / navigate / toast / palette. 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,
  type PluginManifest,
} from "@niyase/plugin-sdk/manifest";
  • defineManifest(m): a typed identity (for completion)
  • validateManifest(input): { ok: true, manifest } | { ok: false, errors } (zod, identical to CLI lint)

Types

PluginManifest / PluginAudience / PluginTableDef / PluginColumnDef / PluginIndustryPreset / PluginI18nTerms / PluginPaletteMetadata / NiyaseBridge / NiyaseContextValue / NiyaseErrorCode.

Test helpers (@niyase/plugin-sdk/host)

  • createTestHost({ manifest, context }): returns a headless bridge connected to the MOCK backend
  • runBridgeConformance(bridge): a minimal conformance check of the bridge contract
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/projects (an example of industry presets) is also a useful reference.