Skip to main content

System requirements

RequirementMinimum version
Node.js>=18.0.0
npm>=9.0.0
TypeScriptAny version compatible with your project (TypeScript >=5.x recommended)
The SDK ships CommonJS artifacts built for Node. It is not designed for direct browser consumption — FDO host wiring is the only supported runtime path.

Install

Run the following command in your plugin project directory:
npm install @anikitenko/fdo-sdk

Import

Import the core types and base class from the root package entry:
import { FDO_SDK, FDOInterface, PluginMetadata } from "@anikitenko/fdo-sdk";
The package exports everything you need for plugin development from this single entry point, including DOM helpers, capability utilities, privileged action helpers, contract validators, and logging utilities. You do not need to import from sub-paths.
The full list of named exports is available in dist/@types/index.d.ts. Your editor’s IntelliSense will surface all available exports as you type.

TypeScript configuration

The package ships TypeScript declarations at dist/@types/index.d.ts. This path is declared in package.json under both the types field and the exports["."].types field, so TypeScript resolves types automatically when you import from @anikitenko/fdo-sdk. No additional paths or typeRoots configuration is required. A minimal tsconfig.json for a plugin project:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "moduleResolution": "node",
    "strict": true,
    "esModuleInterop": true,
    "outDir": "dist"
  },
  "include": ["src"]
}
If TypeScript cannot resolve the types, verify that node_modules/@anikitenko/fdo-sdk/dist/@types/index.d.ts exists. The declaration files are included in the published package under dist/**/*.d.ts.

Distribution mode

The published runtime artifact (dist/fdo-sdk.bundle.js) is a CommonJS bundle intended for Node/Electron environments. The SDK does not expose a browser-global contract. Do not attempt to load the bundle directly in a browser outside of the FDO host runtime.
The package.json exports map is:
{
  "exports": {
    ".": {
      "types": "./dist/@types/index.d.ts",
      "require": "./dist/fdo-sdk.bundle.js",
      "default": "./dist/fdo-sdk.bundle.js"
    }
  }
}
Only the require condition is populated. ESM import of the bundle is not a supported path.

Peer dependency: electron

electron is declared as a peer dependency. It is not bundled into the SDK runtime artifact. FDO provides the Electron runtime; you do not need to install Electron in your plugin project.
If your plugin tooling (for example, a type checker or bundler) warns about a missing electron peer, you can add electron as a dev dependency in your plugin project to satisfy the resolution. The SDK itself does not import Electron at runtime.

What is included in the published package

The following paths are included when you install from npm:
PathContents
dist/**/*.jsRuntime bundle (dist/fdo-sdk.bundle.js)
dist/**/*.d.tsTypeScript declaration files under dist/@types/
dist/**/*.jsonDOM metadata (dist/dom-metadata.json)
docs/**/*.mdSDK documentation for offline reference
examples/Working plugin examples and fixture scaffolds
The examples/ directory includes production-oriented fixture files you can use as starting points:
  • examples/fixtures/minimal-plugin.fixture.ts — smallest valid plugin scaffold
  • examples/fixtures/operator-kubernetes-plugin.fixture.ts — Kubernetes operator pattern
  • examples/fixtures/operator-terraform-plugin.fixture.ts — Terraform operator pattern
  • examples/fixtures/operator-custom-tool-plugin.fixture.ts — generic custom tool scope

Next steps

Once you have the SDK installed, follow the Quick Start guide to write your first plugin.