Deploy & devices
Webhook examples
Push run.start, tool.call, and run.complete to HTTP, Slack, or your own handler.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Push run.start, tool.call, and run.complete to HTTP, Slack, or your own handler.
import { Agent, openai, httpWebhook, type WebhookDestination } from "@agentium/core";
function consoleWebhook(): WebhookDestination {
return {
name: "console",
async send(event, payload) {
const p = payload as Record<string, unknown>;
console.log(event, p.agentName, p.runId);
},
};
}
const agent = new Agent({
name: "assistant",
model: openai("gpt-4o-mini"),
instructions: "Be short.",
webhooks: {
destinations: [
consoleWebhook(),
// httpWebhook({ url: "https://example.com/events", secret: "my-secret" }),
],
events: ["run.start", "run.complete", "run.error", "tool.call"],
},
});
await agent.run("What is 2 + 2?");