JavaScript / TypeScript
Package: @dnotifier-realtime/dnotifier
Setup
import { DNotifier } from "@dnotifier-realtime/dnotifier";
import WebSocket from "ws"; // only if transport: "ws"
const notifier = new DNotifier({
appId: process.env.DNOTIFIER_APP_ID,
secret: process.env.DNOTIFIER_SECRET,
transport: "http",
userId: "user-123",
permissionEnforcement: "backend", // or "disabled" for local demos
onAgentEvent: (event) => {
console.log(event.type, event.toolId, event.message);
},
});
await notifier.connect();Register a local tool
register returns an in-memory tool (id, name, execute, …). Pass that object into defineAgent({ tools: [...] }).
Connect MCP
Define a tool agent
Omit run when tools is set — the SDK runs the tool agent for you.
Run standalone
Inside a workflow
Errors
Typed errors are exported from the package, including ToolNotFoundError, ToolValidationError, PermissionDeniedError, MCPConnectionError, MCPToolError, LLMError, and AgentExecutionError.
Learn more
Last updated