API reference

Webhooks

Get notified when things happen.

Events

EventWhen
message.receivedA subscriber DM arrived on a connector
message.sentThe agent replied
media_request.quotedAgent sent a price
payment.succeededSubscriber paid
video.completedA render finished
queue.pendingSomething is waiting for approval

Verifying signatures

import { verifyWebhook } from "@shedome/sdk";

export async function POST(req: Request) {
  const event = verifyWebhook(await req.text(), req.headers.get("shedome-signature")!, process.env.SHEDOME_WEBHOOK_SECRET!);
  if (event.type === "payment.succeeded") {
    // fulfil
  }
  return new Response("ok");
}