一键导入
iii-node-sdk
Node.js/TypeScript SDK for the iii engine. Use when building workers, registering functions, or invoking triggers in TypeScript or JavaScript.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Node.js/TypeScript SDK for the iii engine. Use when building workers, registering functions, or invoking triggers in TypeScript or JavaScript.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
KTG content marketing pipeline. Takes a written blog post and runs the full publishing workflow: repurpose for all platforms, generate hero image, SEO and AI citation optimisation, then pause for green-light before publishing to all channels via Composio. Local-first: uses Ollama for text tasks where quality allows, cloud for image gen and live data. Use when user says "hub", "/hub", "publish this", "run the pipeline", "post this everywhere".
KTG content marketing pipeline — SWARM MODE. Orchestrates 7 plugins via parallel agent dispatch. Drop a post, get it published everywhere with maximum parallelism. Local-first: Ollama for text, cloud for images and live data. Agents run simultaneously, not sequentially.
KTG content marketing pipeline — SWARM MODE v2. Concrete 11-agent parallel pipeline using the Agent tool. Local-first: Ollama for text, cloud for images and publish. Drop a post, spawn agents, publish everywhere.
Browser SDK for connecting to the iii engine from web applications via WebSocket. Use when building browser-based clients that register functions, invoke triggers, or consume streams from the frontend.
Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
Registers cron triggers with 7-field expressions to run functions on recurring schedules. Use when scheduling periodic jobs, timed automation, crontab replacements, cleanup routines, report generation, batch processing, or calendar-based work that is genuinely time-driven.
| name | iii-node-sdk |
| description | Node.js/TypeScript SDK for the iii engine. Use when building workers, registering functions, or invoking triggers in TypeScript or JavaScript. |
The TypeScript/JavaScript SDK for connecting Node workers to the iii engine.
Full API reference: https://iii.dev/docs/api-reference/sdk-node
npm install iii-sdk
| API | Purpose |
|---|---|
registerWorker(url, options?) | Connect to the engine and return the iii client |
InitOptions | Worker name, metrics, headers, reconnect, OpenTelemetry |
iii.registerFunction(id, handler, options?) | Register a local async function handler |
iii.registerFunction(id, HttpInvocationConfig, options?) | Register an external HTTP endpoint as a function |
iii.registerTrigger({ type, function_id, config, metadata? }) | Bind a trigger to a function |
iii.trigger({ function_id, payload, action?, timeoutMs? }) | Invoke a function |
TriggerAction.Void() | Fire-and-forget invocation mode |
TriggerAction.Enqueue({ queue }) | Durable async invocation mode |
iii.createChannel(bufferSize?) | Binary/text streaming between workers |
ChannelReader / ChannelWriter | Consume/write channel payloads |
Logger | Structured logs with OpenTelemetry fallback |
withSpan | OpenTelemetry custom spans |
IIIInvocationError | Remote invocation error with code and function_id |
iii.registerTriggerType({ id, description }, handler) | Custom trigger type registration |
registerWorker(address, options?) supports:
workerNameenableMetricsReportinginvocationTimeoutMsreconnectionConfig (initialDelayMs, maxDelayMs, backoffMultiplier, jitterFactor, maxRetries)headersotelUse headers only for server-side Node workers. Browser workers cannot send custom WebSocket headers.
iii.registerFunction('orders::validate', async (payload) => result, { description, metadata, request_format, response_format })iii.registerFunction('legacy::charge', { url, method, timeout_ms, headers, auth }, options?)metadata is discoverable through engine function listings and should contain stable ownership or capability data, not secrets.{ type: 'hmac', secret_key }, { type: 'bearer', token_key }, and { type: 'api_key', header, value_key }.trigger() waits for the result and rejects on handler/engine errors.TriggerAction.Void() returns undefined after dispatch; use only for optional side effects.TriggerAction.Enqueue({ queue }) returns { messageReceiptId } after the job is accepted.timeoutMs overrides the invocation timeout for a single call.IIIInvocationError; inspect error.code for FORBIDDEN, TIMEOUT, function_not_found, function_not_invokable, invocation_failed, and invocation_stopped.const channel = await iii.createChannel()channel.readerRef or channel.writerRef through a trigger() payload.channel.writer.stream.write(buffer) or text messages with channel.writer.sendMessage(text).reader.stream, reader.readAll(), and text messages with reader.onMessage(callback).When implementing an auth function for RBAC workers, the AuthResult supports:
| Field | Purpose |
|---|---|
allowed_functions: string[] | Additional function IDs to allow |
forbidden_functions: string[] | Function IDs to deny (overrides expose_functions) |
allowed_trigger_types?: string[] | Trigger types the worker may register |
allow_trigger_type_registration | Whether the worker can register new trigger types |
function_registration_prefix? | Prefix applied to functions registered by worker |
context: Record<string, unknown> | Arbitrary context forwarded to middleware/handlers |
For browser environments, use iii-browser-sdk. It has browser-specific security and WebSocket constraints; see iii-browser-sdk for details.
iii-functions-and-triggersiii-http-endpointsiii-http-middlewareiii-browser-sdkiii-channelsiii-error-handlingiii-python-sdkiii-rust-sdkiii-node-sdk in the iii engine.