@rocketman-streamkit/types
v1.0.12
Published
TypeScript declarations for the StreamKit+ integration addon sandbox API
Maintainers
Readme
@rocketman-streamkit/types
TypeScript declarations for the StreamKit+ integration addon sandbox API.
Use this package when developing worker addons outside the StreamKit+ repository. It provides global typings for network, events, permissions, dashboard, GenerateConfig, and the rest of the VM sandbox surface — the same declarations that StreamKit+ generates from its internal API source.
Version sync: package version matches the StreamKit+ app release it was built from. Install a version that corresponds to the StreamKit+ build your addon targets.
Documentation
API reference, manifest format, permissions, and addon categories are published in a separate repository — one branch per StreamKit+ version:
rocketman-streamkit.github.io/types (web, with AI assistant)
Source and markdown: github.com/RocketMan-StreamKit/types — open the branch that matches your target app version (for example 1.0.12) and start from index.md or index.html.
This npm package provides TypeScript typings only; the docs repo is the full written guide.
For AI coding agents
When building StreamKit+ integration addons with an AI assistant, point it at these resources:
| Resource | Value |
| --- | --- |
| Context7 library ID | /rocketman-streamkit/types |
| Context7 registry | https://context7.com/rocketman-streamkit/types |
| Web docs + chat widget | https://rocketman-streamkit.github.io/types/ |
| llms.txt index | https://rocketman-streamkit.github.io/types/llms.txt |
| Package manifest | ai.manifest.json (shipped with this npm package) |
Cursor / MCP: enable Context7 and ask the agent to use library /rocketman-streamkit/types for sandbox API, manifest, and permissions questions.
Custom tooling: after npm install, read node_modules/@rocketman-streamkit/types/ai.manifest.json — it links this package to the Context7 registry entry above.
Install @rocketman-streamkit/types@<version> matching the StreamKit+ release you target (manifest.json → app_version). For another app version, use the matching docs branch: https://github.com/RocketMan-StreamKit/types/branches
Installation
npm install --save-dev @rocketman-streamkit/typesOr with yarn / pnpm:
yarn add -D @rocketman-streamkit/types
pnpm add -D @rocketman-streamkit/typesSetup
Addon worker code runs inside a VM with global sandbox APIs — no import of the SDK at runtime. TypeScript only needs the declaration file for editor checks and tsc --noEmit.
Recommended tsconfig.json
{
"compilerOptions": {
"types": [],
"lib": ["ES2020"],
"noEmit": true,
"strict": true,
"skipLibCheck": true
},
"include": ["./**/*.ts", "./node_modules/@rocketman-streamkit/types/addon.d.ts"]
}Alternatively, reference the package types field directly:
{
"compilerOptions": {
"types": ["@rocketman-streamkit/types"],
"lib": ["ES2020"],
"noEmit": true,
"strict": true,
"skipLibCheck": true
},
"include": ["./**/*.ts"]
}Do not add @types/node — addon workers are not Node.js processes.
Do not include "DOM" in compilerOptions.lib — sandbox globals such as URL, console, and status intentionally replace browser typings.
The npm package ships tsconfig.json; you can extend it in your addon project:
{
"extends": "./node_modules/@rocketman-streamkit/types/tsconfig.json",
"include": ["./**/*.ts"]
}Examples
HTTP endpoint
Register a POST handler exposed at http://localhost:{port}/addon/{yourAddonId}/hook:
network.endpoints.create('hook', 'POST', 'onHook');
events.On('onHook', ({ body, query, params }) => {
console.log('Incoming webhook', body);
return { ok: true };
});Settings schema
Call GenerateConfig once at addon load to register settings fields shown in the StreamKit+ UI:
await GenerateConfig([
{
key: 'channel_id',
type: 'text',
default: '',
editor: {
label: { en: 'Channel ID', ru: 'ID канала' },
required: true,
},
},
{
key: 'enabled',
type: 'boolean',
default: true,
editor: { label: { en: 'Enabled' } },
},
]);
const params = await api.config.getParams<{ channel_id: string; enabled: boolean }>();App UI locale (LANG)
Read-only bridge to the user's language setting in StreamKit+ (en, ru, uk). No permission required:
const labels = {
en: 'Connected',
ru: 'Подключено',
uk: 'Підключено',
};
status.Update({ current: 'online', message: { [LANG.current]: labels[LANG.current] } });
const sub = LANG.onChangeLanguage((lang) => {
console.log('UI locale changed:', lang);
});
// later: sub.Destroy();Outbound HTTP request
Requires NETWORK_REQUEST permission in manifest.json:
const response = await network.request.get('https://api.example.com/status');
console.log(response.status, response.body);Dashboard events
Requires DASHBOARD_EVENTS permission:
dashboard.registerPlatform({ id: 'my_platform', name: { en: 'My Platform' } });
dashboard.addRecord(
{
type: 'follow',
platform: 'my_platform',
message: { en: 'New follower!' },
},
{ id: 'user_1', name: 'ViewerName' }
);Addon-to-addon RPC
Request data from another enabled addon:
// In addon A
addons.onRequest('getChannelId', () => ({ channelId: '12345' }));
// In addon B
const { channelId } = await addons.request<{ channelId: string }>(
'addon_a',
'getChannelId'
);manifest.json permissions
Declared permissions must match sandbox API usage. Common values:
| Permission | Used for |
| --- | --- |
| WEB_END_POINTS | network.endpoints.create |
| NETWORK_REQUEST | network.request.* |
| NETWORK_WEBSOCKET | network.websocket.connect |
| DASHBOARD_EVENTS | dashboard.addRecord, dashboard.registerTriggers |
| DASHBOARD_CHAT | dashboard.addChatMessage, chat badges |
| WEB_CONTENT | Static web page served at /addon_static/{id}/ |
| STATUS | status.Update, status.OnClick |
| NOTIFY | notify.Send |
See the AddonsPermission union in the declaration file for the full list.
What's included
The published addon.d.ts is a declare global module:
- Sandbox globals:
network,events,permissions,api,dashboard,addons,data,status,notify,game,storage,crypto, timers, etc. GenerateConfigand settings schema typesAddonsPermissionenum-as-union- Supporting types (
DashboardLocalizedText, config field types, …)
Runtime behaviour (timeouts, host blocklists, permission gates) is enforced by StreamKit+ — typings describe the API surface only.
Support
This package tracks the StreamKit+ sandbox API. If typings are missing or outdated for your app version, install the matching @rocketman-streamkit/types release or report an issue to the StreamKit+ maintainers.
