>_better-webhook
CLI

Templates

Use pre-built webhook templates to test your handlers without triggering real events.

Templates

Templates are pre-built webhook payloads that you can use to test your handlers without triggering real events. They include proper headers and can generate valid signatures.

Available Templates

GitHub

Template IDEventDescription
github-pushpushCommits pushed to a repository
github-pull_requestpull_requestPull request opened, closed, merged, etc.
github-issuesissuesIssue opened, closed, edited, etc.
github-installationinstallationGitHub App installed or uninstalled
github-installation_repositoriesinstallation_repositoriesRepos added/removed from app

Ragie

Template IDEventDescription
ragie-document_status_updateddocument_status_updatedDocument enters indexed, ready, or failed state
ragie-document_deleteddocument_deletedDocument is deleted
ragie-entity_extractedentity_extractedEntity extraction completes
ragie-connection_sync_startedconnection_sync_startedConnection sync begins
ragie-connection_sync_progressconnection_sync_progressPeriodic sync progress updates
ragie-connection_sync_finishedconnection_sync_finishedConnection sync completes
ragie-connection_limit_exceededconnection_limit_exceededConnection page limit exceeded
ragie-partition_limit_exceededpartition_limit_exceededPartition document limit exceeded

Stripe

Template IDEventDescription
stripe-charge_failedcharge.failedCharge attempt fails (declined card, auth failure, etc.)
stripe-checkout_session_completedcheckout.session.completedCheckout session completes successfully
stripe-payment_intent_succeededpayment_intent.succeededPaymentIntent transitions to succeeded

Recall.ai

Template IDEventDescription
recall-participant_events_joinparticipant_events.joinParticipant joined event
recall-participant_events_leaveparticipant_events.leaveParticipant left event
recall-participant_events_updateparticipant_events.updateParticipant updated details
recall-participant_events_speech_onparticipant_events.speech_onParticipant speech on
recall-participant_events_speech_offparticipant_events.speech_offParticipant speech off
recall-participant_events_webcam_onparticipant_events.webcam_onParticipant webcam on
recall-participant_events_webcam_offparticipant_events.webcam_offParticipant webcam off
recall-participant_events_screenshare_onparticipant_events.screenshare_onParticipant screenshare on
recall-participant_events_screenshare_offparticipant_events.screenshare_offParticipant screenshare off
recall-participant_events_chat_messageparticipant_events.chat_messageParticipant chat message
recall-transcript_datatranscript.dataTranscript final data event
recall-transcript_partial_datatranscript.partial_dataTranscript partial data event
recall-bot_joining_callbot.joining_callBot joining call status event
recall-bot_in_waiting_roombot.in_waiting_roomBot in waiting room status event
recall-bot_in_call_not_recordingbot.in_call_not_recordingBot in call not recording status event
recall-bot_recording_permission_allowedbot.recording_permission_allowedBot recording permission allowed status
recall-bot_recording_permission_deniedbot.recording_permission_deniedBot recording permission denied status
recall-bot_in_call_recordingbot.in_call_recordingBot in call recording status event
recall-bot_call_endedbot.call_endedBot call ended status event
recall-bot_donebot.doneBot done status event
recall-bot_fatalbot.fatalBot fatal status event
recall-bot_breakout_room_enteredbot.breakout_room_enteredBot breakout room entered
recall-bot_breakout_room_leftbot.breakout_room_leftBot breakout room left
recall-bot_breakout_room_openedbot.breakout_room_openedBot breakout room opened
recall-bot_breakout_room_closedbot.breakout_room_closedBot breakout room closed

Recall template signing expects RECALL_WEBHOOK_SECRET to use the whsec_ format from Recall.

Stripe template signing expects STRIPE_WEBHOOK_SECRET (whsec_...) and generates Stripe-Signature as t=<unix>,v1=<hmac_sha256>.

Stripe retries produce a new Stripe-Signature timestamp/signature per delivery attempt. For idempotency, dedupe Stripe webhooks by body.id (event id), not by signature value.

Commands

List Remote Templates

View all templates available from the repository:

better-webhook templates list

Filter by provider:

better-webhook templates list --provider github
better-webhook templates list --provider stripe

Download Templates

Download a specific template:

better-webhook templates download github-push

Download all available templates:

better-webhook templates download --all

If templates are already present locally, running download again skips them by default. Use --refresh to force a fresh index fetch and re-download existing templates (for both download <template-id> and download --all).

List Local Templates

View templates you've downloaded:

better-webhook templates list --local

Delete a Local Template

Delete one downloaded template by exact ID:

better-webhook templates delete github-push

Search Templates

Search by name, provider, or event:

better-webhook templates search push
better-webhook templates search github

Clean Up

Remove all downloaded templates:

better-webhook templates clean

Clear the template cache (forces re-fetch of the index):

better-webhook templates cache clear

Running Templates

Use the templates run command to execute a template against your endpoint:

better-webhook templates run github-push http://localhost:3000/api/webhooks/github

With Signature Generation

To generate a valid signature, provide the webhook secret:

better-webhook templates run github-push \
  http://localhost:3000/api/webhooks/github \
  --secret "your-webhook-secret"

better-webhook templates run stripe-charge_failed \
  http://localhost:3000/api/webhooks/stripe \
  --secret "whsec_test_123"

If you do not pass --secret, the CLI resolves secrets in this order:

  1. <PROVIDER>_WEBHOOK_SECRET (for example GITHUB_WEBHOOK_SECRET, STRIPE_WEBHOOK_SECRET, or RAGIE_WEBHOOK_SECRET)
  2. WEBHOOK_SECRET

With Custom Headers

Add or override headers:

better-webhook templates run github-push \
  http://localhost:3000/api/webhooks/github \
  -H "X-Custom-Header:value"

Verbose Output

See detailed request and response information:

better-webhook templates run github-push \
  http://localhost:3000/api/webhooks/github \
  --verbose

Workflow Example

A typical development workflow with templates:

# 1. Download templates you need
better-webhook templates download github-push
better-webhook templates download github-pull_request

# 2. Start your development server
# (in another terminal)
npm run dev

# 3. Test your webhook handler
better-webhook templates run github-push \
  http://localhost:3000/api/webhooks/github \
  --secret $GITHUB_WEBHOOK_SECRET

# 4. Iterate - run the same template while fixing issues
better-webhook templates run github-push \
  http://localhost:3000/api/webhooks/github \
  --secret $GITHUB_WEBHOOK_SECRET

Templates give you repeatable, consistent webhook payloads for testing without needing to trigger real events.

On this page