Skip to main content

Documentation Index

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

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

Register handlers that run after mesa.webhooks.receive(...) verifies and validates an incoming webhook request.
mesa.webhooks.on('push', async (event) => {
  for (const update of event.data.updates) {
    console.log(update.bookmark, update.action);
  }
});
Register the same handler for multiple event names:
mesa.webhooks.on(['push', 'repo.created'], async (event) => {
  console.log(event.type, event.id);
});

Options

name
WebhookEventName | WebhookEventName[]
required
Event name or event names to handle.
handler
WebhookHandler
required
Function called with the typed event. It may return void or a promise.

Event names

Supported event names include repo.created, repo.updated, repo.deleted, bookmark.created, bookmark.deleted, bookmark.moved, bookmark.merged, change.created, change.evolved, push, sync_run.enqueued, sync_run.started, sync_run.completed, and sync_run.failed.

Response

Returns void.

Handler errors

Handlers are run during mesa.webhooks.receive(...). If one or more handlers reject, receive throws an AggregateError after all matching handlers have settled.