API Reference

This document summarizes the main TypeScript exports from @nimbalyst/extension-sdk.

Main Imports

import type {
  ExtensionContext,
  ExtensionManifest,
  ExtensionModule,
  EditorHostProps,
  ExtensionAITool,
  AIToolContext,
  ExtensionToolResult,
  PanelHostProps,
  SettingsPanelProps,
} from '@nimbalyst/extension-sdk';

import { REQUIRED_EXTERNALS, validateExtensionBundle } from '@nimbalyst/extension-sdk';
import { createExtensionConfig } from '@nimbalyst/extension-sdk/vite';

Extension Entry Point

Your extension module can export any subset of these fields:

ExtensionContext

Passed to activate() and available inside AIToolContext.extensionContext.

ExtensionServices

ExtensionAIService

Available when permissions.ai is true. Provides AI tool registration and direct access to chat/completion models.

Chat Completion Types

Custom Editors

Custom editors receive a single host prop. Use the useEditorLifecycle hook (from @nimbalyst/extension-sdk) to handle all lifecycle concerns.

useEditorLifecycle Hook

EditorHost Interface

The useEditorLifecycle hook wraps this interface. You rarely need to use it directly.

Supporting editor types:

AI Tools

JSON Schema Types

Panels

Panels are non-file-based extension UIs.

Extension Storage

ExtensionStorage is available to custom editors, panels, and settings panels.

Manifest Types

The manifest shape is defined by ExtensionManifest and ExtensionContributions. See Manifest Reference for field-by-field guidance.

Vite Helper

Use createExtensionConfig() to get the correct externalization and output shape for extensions.

Validation Helpers

Required Externals

REQUIRED_EXTERNALS exports the package names that must stay external in your build because Nimbalyst provides them at runtime.

Last updated