HTTP trigger
Webhook handlers, deployed in seconds
Every deployed hostfunc function gets a stable HTTPS run URL. That makes it the fastest way to stand up a webhook endpoint for Stripe, GitHub, Slack, or any service that POSTs JSON — no server, no API gateway, no boilerplate.
The problem
Webhook receivers are tiny but annoying to host: you need a public URL, request validation, secret handling for signature checks, and somewhere to see what actually arrived. Standing up a whole service for 20 lines of logic is overkill.
How hostfunc solves it
- Each function has a stable URL at /run/you/your-fn — paste it straight into the provider's webhook settings.
- Read signing secrets with secret.getRequired() to verify signatures; secrets are encrypted at rest and fetched at run time.
- Live log streaming shows each incoming payload as it arrives — no redeploys to debug.
- Compose downstream: a webhook handler can call other functions (notify, enrich, persist) via fn.executeFunction.
stripe-webhook.ts
import fn, { secret } from "@hostfunc/sdk";
// POST endpoint — paste the run URL into Stripe's webhook settings.
export async function main(event: { type: string; data: unknown }) {
const signingSecret = await secret.getRequired("STRIPE_WEBHOOK_SECRET");
// ...verify the signature with signingSecret...
if (event.type === "checkout.session.completed") {
await fn.executeFunction("you/slack-notify", {
channel: "#sales",
text: "New checkout completed 🎉",
});
}
return { received: true };
}