npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stream-kit/plugin

v0.2.0-alpha.8

Published

Public TypeScript API for Stream Kit plugin authors

Readme

@stream-kit/plugin

Public TypeScript API for Stream Kit plugin authors.

Types are extracted from the app source and bundled into a standalone declaration file. Runtime helpers are re-exported from @stream-kit/core; filesystem enums ship from this package.

When to use it

Use @stream-kit/plugin for everything that defines or types your plugin:

import type {
	Plugin,
	PluginAppApi,
	HandlerDefinitionProps,
	TriggerDefinitionProps
} from '@stream-kit/plugin';

import { getFieldValue, interpolateVariables } from '@stream-kit/core';
import { BaseDirectory } from '@stream-kit/plugin';

| Need | Package | Notes | |------|---------|-------| | Types (Plugin, PluginAppApi, definitions) | @stream-kit/plugin | Use import type | | Runtime helpers (getFieldValue, parseCommand, cron) | @stream-kit/core | Preferred for helpers | | BaseDirectory, SeekMode | @stream-kit/plugin | Required for app.fs options | | Svelte UI (custom views/widgets only) | @stream-kit/ui | Dev dependency; externalize at build time | | Platform features | app (PluginAppApi) | Filesystem, toast, process, hotkeys, audio, store |

Never import @tauri-apps/* in plugin code. Use app.fs, app.process, and other PluginAppApi surfaces instead.

Installation

External plugins add this package as a dev dependency and externalize it at build time:

npm install --save-dev @stream-kit/plugin @stream-kit/core

For custom Svelte views or dashboard widgets (built-in-style plugins only), also add:

npm install --save-dev @stream-kit/ui

At runtime the Stream Kit app host resolves @stream-kit/plugin from the plugin import map. Do not bundle @stream-kit/plugin, @stream-kit/core, or @stream-kit/ui into your plugin entry.

The npm package ships dist/index.js, but Stream Kit always loads the host bundle at runtime. Keep host modules externalized in your Vite or Rollup config.

Plugin shape

import type { Plugin } from '@stream-kit/plugin';

const plugin: Plugin = (app) => ({
	name: 'My Plugin',
	handlers: [],
	triggers: [],
	menuItems: []
});

export default plugin;

The app host dynamically imports your plugin entry from the installed manifest.

What this package exports

Plugin contract

  • Plugin, PluginRegistration — entry function and return shape
  • PluginAppApi — filesystem, audio, process, OAuth, toast, plugins, db, …
  • PluginStore — per-plugin JSON persistence (plugin.{key}.json)
  • PluginPublicApi — optional API surface for other plugins via app.plugins.get(key)

Actions

  • Action, ActionHandler, ActionTrigger
  • HandlerDefinitionProps, HandlerExecuteFn, HandlerNext
  • TriggerDefinitionProps, TriggerTestFn, TriggerValidateFormFn
  • Handler field types (HandlerFieldDefinition, HandlerFieldValue, one-of variants, …)
  • Condition tree types (ConditionNode, Operator, …)

Settings and UI schema

  • PluginSettingsFieldDefinition, PluginSettingsFieldSectionDefinition
  • PluginPageDefinition, PluginPageBlock, form block types
  • PluginMenuItemDefinition, PluginWidgetDefinition
  • PluginCustomViewProps — for Svelte custom views registered by built-in npm plugins

Declarative menu pages are rendered by Stream Kit with @stream-kit/ui. Zip-distributed plugins must use page blocks only; do not pass Svelte components or raw HTML for menu pages.

Platform types

  • Filesystem: BaseDirectory, SeekMode, FileHandle (type), ReadFileOptions, WatchEvent, …
  • Process: RunProgramOptions, ProcessEventContext
  • Lifecycle: AppLifecycleEvent, AppLifecycleContext
  • Core plugin API types: CorePluginApi, VariableScope, collection types
  • Bot command types: CommandRecord, CommandPermissions, …
  • TTS: LocalTtsVoiceInfo, LocalTtsRuntimeInfo

Runtime re-exports from @stream-kit/core

getFieldValue, interpolateVariables, cron helpers, command parsers, and related types are re-exported so plugin code can use a single import path when convenient.

Subpath stubs

Type-only subpaths exist for tooling that expects separate entry points:

| Subpath | Purpose | |---------|---------| | @stream-kit/plugin/action | Action-related type stubs | | @stream-kit/plugin/utils | Utility type stubs |

Runtime code should import helpers from @stream-kit/core and BaseDirectory / SeekMode from @stream-kit/plugin.

IDE hover and autocomplete

JSDoc in the source types flows into dist/index.d.ts when this package is built. Hover on imports from @stream-kit/plugin and @stream-kit/core, and on app. methods in handler execute functions, to read parameter descriptions and examples without leaving the editor.

Monorepo development

pnpm --filter @stream-kit/plugin build
pnpm --filter @stream-kit/plugin check
pnpm --filter @stream-kit/plugin dev

When the app API changes, rebuild @stream-kit/plugin before publishing to npm or syncing the plugin-starter template.

Further reading