Agent skill
iii-browser-sdk
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.
Install this agent skill to your Project
npx add-skill https://github.com/iii-hq/iii/tree/main/skills/iii-browser-sdk
SKILL.md
Browser SDK
The browser-optimized SDK for connecting web applications to the iii engine.
Documentation
Full API reference: https://iii.dev/docs/api-reference/sdk-browser
Install
npm install iii-browser-sdk
Key Exports
| Export | Purpose |
|---|---|
registerWorker(address, options?) |
Connect to the engine via WebSocket |
registerFunction(id, handler) |
Register a browser-side function handler |
registerTrigger({ type, function_id, config, metadata? }) |
Bind a trigger to a function |
trigger({ function_id, payload, action? }) |
Invoke a function |
TriggerAction.Void() |
Fire-and-forget invocation mode |
TriggerAction.Enqueue({ queue }) |
Durable async invocation mode |
registerTriggerType({ id, description }, { registerTrigger, unregisterTrigger }) |
Custom trigger type registration |
createChannel() |
Binary streaming between workers |
Key Differences from Node SDK
- No custom WebSocket headers — uses query parameters for auth tokens
- No
Loggerexport — use browser console or your own logging - No worker metadata telemetry reporting
- Connects directly via
ws://orwss://URL (noregisterWorkerURL options) - Same function/trigger/channel API surface as the Node SDK
Quick Start
import { registerWorker, TriggerAction } from 'iii-browser-sdk'
const iii = registerWorker('ws://localhost:49135')
iii.registerFunction('ui::greet', async (data) => {
return { message: `Hello, ${data.name}!` }
})
const result = await iii.trigger({
function_id: 'backend::get-user',
payload: { userId: '123' },
})
await iii.trigger({
function_id: 'analytics::track',
payload: { event: 'page_view' },
action: TriggerAction.Void(),
})
Common Patterns
Code using this pattern commonly includes, when relevant:
registerWorker('ws://host:49135')— connect from browserregisterWorker('wss://host:49135')— connect with TLS in productioniii.registerFunction(id, handler)— register browser-side handleriii.trigger({ function_id, payload })— call server-side functionsiii.trigger({ ..., action: TriggerAction.Void() })— fire-and-forget from browser- Stream connections at
ws://host:3112/stream/{name}/{group}for real-time updates
Pattern Boundaries
- For server-side Node.js workers, prefer
iii-node-sdk. - For real-time stream consumption patterns, see
iii-realtime-streams. - For Python or Rust workers, see
iii-python-sdkoriii-rust-sdk. - Stay with
iii-browser-sdkwhen the client is a web browser.
When to Use
- Use this skill when the task is primarily about
iii-browser-sdkin the iii engine. - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
iii-dead-letter-queues
Inspects and redrives jobs that exhausted all retries. Use when handling failed queue jobs, debugging processing errors, or implementing retry strategies.
iii-cron-scheduling
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, health checks, batch processing, or any task that should run every N seconds, minutes, hours, or on a weekly/monthly calendar.
iii-http-invoked-functions
Registers external HTTP endpoints as iii functions using registerFunction(id, HttpInvocationConfig). Use when adapting legacy APIs, third-party webhooks, or immutable services into triggerable iii functions, especially when prompts ask for endpoint maps like { path, id } iterated into registerFunction calls.
iii-channels
Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
iii-event-driven-cqrs
Implements CQRS with event sourcing on the iii engine. Use when building command/query separation, event-sourced systems, or fan-out architectures where commands publish domain events and multiple read model projections subscribe independently.
iii-agentic-backend
Creates and orchestrates multi-agent pipelines on the iii engine. Use when building AI agent collaboration, agent orchestration, research/review/synthesis chains, or any system where specialized agents hand off work through queues and shared state.
Didn't find tool you were looking for?