From hex-pack
Polls Hex API for project run status and triggers callbacks on completion or error for notifications, simulating webhooks since none exist.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hex-pack:hex-webhooks-eventsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Hex doesn't provide push webhooks. For event-driven integrations, poll run status or build your own notification system around run completions.
Hex doesn't provide push webhooks. For event-driven integrations, poll run status or build your own notification system around run completions.
async function runWithCallback(
client: HexClient,
projectId: string,
params: Record<string, any>,
onComplete: (result: any) => void,
onError: (error: Error) => void
) {
try {
const { runId } = await client.runProject(projectId, params);
const poll = async () => {
const status = await client.getRunStatus(projectId, runId);
if (status.status === 'COMPLETED') { onComplete(status); return; }
if (status.status === 'ERRORED' || status.status === 'KILLED') { onError(new Error(status.status)); return; }
setTimeout(poll, 5000);
};
poll();
} catch (err) { onError(err as Error); }
}
runWithCallback(client, 'project-id', { date: '2025-01-01' },
(result) => {
// Send Slack notification, email, etc.
fetch(process.env.SLACK_WEBHOOK_URL!, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: `Hex project completed: ${result.runId}` }),
});
},
(error) => console.error('Run failed:', error)
);
npx claudepluginhub p/kriptoburak-hex-pack-plugins-saas-packs-hex-packPolls Hex API for project run status and triggers callbacks on completion or error for notifications, simulating webhooks since none exist.
Designs reliable webhook systems using Stripe patterns: resource.action event naming, JSON envelope payloads, HMAC-SHA256 signing, exponential backoff retries, deduplication, and endpoint implementation.
Creates webhook endpoints with HMAC signature verification, idempotency checks, payload parsing, and async retry handling for Stripe, GitHub, Twilio.