Skip to content

feat: allow disabling automatic webhook route registration - #35

Merged
bjarn merged 1 commit into
mainfrom
cursor/optional-webhook-route-6a87
Aug 28, 2026
Merged

bjarn merged 1 commit into
mainfrom
cursor/optional-webhook-route-6a87

Conversation

@bjarn

@bjarn bjarn commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #33.

The package always registered POST /{prefix}/webhook via Spatie hasRoute('webhooks') in configurePackage, with no way to opt out. That hook also runs before package config is merged, so a config flag cannot be read there.

Change

  • Add webhooks.enabled (env: LETTERMINT_WEBHOOK_ENABLED, default true) so existing apps keep the auto-registered route
  • Register the package route from bootingPackage() only when that flag is true (after config merge, before Spatie loads routes)
  • Document how to disable auto-registration and wire WebhookController + VerifyWebhookSignature yourself (including domain/subdomain grouping)

Tests

  • Route exists by default (lettermint.webhook → /{prefix}/webhook)
  • Route is absent when webhooks.enabled is false

Package version is unchanged.

Open in Web Open in Cursor 

Add a backward-compatible webhooks.enabled config flag (default true) so
apps can skip the package webhook route and register WebhookController
with VerifyWebhookSignature themselves.

Fixes #33

Co-authored-by: Bjarn Bronsveld <bjarn@users.noreply.github.com>
@bjarn
bjarn marked this pull request as ready for review August 28, 2026 07:24
@bjarn
bjarn requested a review from Bjornftw August 28, 2026 07:24
@bjarn
bjarn merged commit 83fb981 into main Aug 28, 2026
19 checks passed
@bjarn
bjarn deleted the cursor/optional-webhook-route-6a87 branch August 28, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional route registration

3 participants