Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt

Use this file to discover all available pages before exploring further.

The Xquik plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see Overview for setup context and the exact URL shape).
New to Corsair? See webhooks and hooks.

Webhook map

  • events
    • monitor (events.monitor)
    • test (events.test)

HTTP handler setup

app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();
    const result = await processWebhook(corsair, headers, body);
    return result.response;
}

Events

Events

Monitor

events.monitor Handle a signed Xquik monitor event delivery Payload
NameTypeRequiredDescription
dataobjectYes
deliveryIdstringNo
eventTypetweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.testYes
occurredAtstringNo
querystringNo
schemaVersionstringNo
streamEventIdstringNo
timestampstringNo
usernamestringNo
{
}
{
  data: {
  },
  deliveryId?: string,
  eventType: tweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.test,
  occurredAt?: string,
  query?: string,
  schemaVersion?: string,
  streamEventId?: string,
  timestamp?: string,
  username?: string
}
webhookHooks example
xquik({
    webhookHooks: {
        events: {
            monitor: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})

Test

events.test Handle a signed Xquik test webhook delivery Payload
NameTypeRequiredDescription
dataobjectYes
deliveryIdstringNo
eventTypetweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.testYes
occurredAtstringNo
querystringNo
schemaVersionstringNo
streamEventIdstringNo
timestampstringNo
usernamestringNo
{
}
{
  data: {
  },
  deliveryId?: string,
  eventType: tweet.new | tweet.quote | tweet.reply | tweet.retweet | webhook.test,
  occurredAt?: string,
  query?: string,
  schemaVersion?: string,
  streamEventId?: string,
  timestamp?: string,
  username?: string
}
webhookHooks example
xquik({
    webhookHooks: {
        events: {
            test: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})