[PR #913] [MERGED] feat: implement webhooks #1245

Closed
opened 2026-02-26 19:32:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/913
Author: @catalinpit
Created: 2/6/2024
Status: Merged
Merged: 2/28/2024
Merged by: @Mythie

Base: mainHead: feat/webhook-implementation


📝 Commits (10+)

  • edeeaa5 feat: implement webhooks
  • b3514bd add new webhook dialog
  • ddb9dd1 feat: added backend stuff
  • 0209127 feat: delete webhook functionality
  • 6195898 feat: more webhook functionality
  • 019db27 feat: trigger webhook functionality
  • 7f3f6f5 feat: hide secret field
  • 4d6e780 chore: merge main
  • a1459b4 Merge branch 'main' into feat/webhook-implementation
  • cd240ae chore: loading spinner

📊 Changes

55 files changed (+2180 additions, -27 deletions)

View changed files

apps/web/src/app/(dashboard)/settings/webhooks/[id]/page.tsx (+201 -0)
apps/web/src/app/(dashboard)/settings/webhooks/page.tsx (+101 -0)
apps/web/src/app/(teams)/t/[teamUrl]/settings/webhooks/[id]/page.tsx (+206 -0)
apps/web/src/app/(teams)/t/[teamUrl]/settings/webhooks/page.tsx (+106 -0)
📝 apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx (+14 -1)
📝 apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx (+14 -1)
apps/web/src/components/(dashboard)/settings/webhooks/create-webhook-dialog.tsx (+232 -0)
apps/web/src/components/(dashboard)/settings/webhooks/delete-webhook-dialog.tsx (+172 -0)
apps/web/src/components/(dashboard)/settings/webhooks/trigger-multiselect-combobox.tsx (+93 -0)
📝 apps/web/src/components/(teams)/settings/layout/desktop-nav.tsx (+15 -1)
📝 apps/web/src/components/(teams)/settings/layout/mobile-nav.tsx (+15 -1)
apps/web/src/components/forms/webhook.tsx (+0 -0)
apps/web/src/pages/api/v1/me/index.ts (+3 -0)
apps/web/src/pages/api/v1/zapier/list-documents/index.ts (+3 -0)
apps/web/src/pages/api/v1/zapier/subscribe/index.ts (+3 -0)
apps/web/src/pages/api/v1/zapier/unsubscribe/index.ts (+3 -0)
apps/web/src/pages/api/webhook/trigger.ts (+12 -0)
📝 apps/web/src/providers/team.tsx (+2 -2)
packages/lib/server-only/crypto/sign.ts (+12 -0)
packages/lib/server-only/crypto/verify.ts (+12 -0)

...and 35 more files

📄 Description

Description

This PR adds support for webhooks.

This feature allows users to:

  • Create, edit, delete webhooks
  • Get notified when certain events happen such as a document being created or signed (for the time being)

These changes do not include the following, which are planned for a future release:

  • Users modifying the payload
  • Webhook ping test
  • Logs (see the latest invocations and the event trigger & payload & timestamp & webhook url for each invocation)
  • Cron jobs for re-trying failed invocations
  • Rate limiting

Testing Performed

Tested the functionality of creating/editing/deleting a webhook locally.
Tested the webhook with https://webhook.site and the webhooks are triggered

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.

Additional Notes

  • UI design needs to be refined
  • More testing from the reviewers and E2E tests

Summary by CodeRabbit

  • New Features

    • Added Webhooks management functionality across desktop and mobile navigation with the ability to create, view, edit, and delete webhooks.
    • Introduced a multi-select combobox for selecting webhook trigger events.
    • Implemented webhook trigger functionality for document-related events (creation, sending, viewing, and completion).
    • Extended the WebhookTriggerEvents enum to include new document-related events.
    • Added a new WebhookCall table to log webhook calls, including request and response details.
    • Enhanced UI components, such as the Badge component, to support different sizes.
  • Bug Fixes

    • N/A
  • Documentation

    • N/A
  • Refactor

    • Refactored document update logic to trigger webhooks post-update.
  • Style

    • N/A
  • Tests

    • N/A
  • Chores

    • Performed database migrations to support new webhook functionalities and schema changes.
  • Revert

    • N/A

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/913 **Author:** [@catalinpit](https://github.com/catalinpit) **Created:** 2/6/2024 **Status:** ✅ Merged **Merged:** 2/28/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/webhook-implementation` --- ### 📝 Commits (10+) - [`edeeaa5`](https://github.com/documenso/documenso/commit/edeeaa56518f9b9b5c5b4fe8f39bb64856e9558b) feat: implement webhooks - [`b3514bd`](https://github.com/documenso/documenso/commit/b3514bd0c7ada00debf38e6609ab18d23a5a62f5) add new webhook dialog - [`ddb9dd1`](https://github.com/documenso/documenso/commit/ddb9dd11d7824c50825d772abcb943f0a641dbc1) feat: added backend stuff - [`0209127`](https://github.com/documenso/documenso/commit/0209127136556074cc026fb621b513b1c258e186) feat: delete webhook functionality - [`6195898`](https://github.com/documenso/documenso/commit/61958989b46db31efcc6fe6b6c9d711d089d26d4) feat: more webhook functionality - [`019db27`](https://github.com/documenso/documenso/commit/019db27b1d4b040cdbacf2df791f37efbd362478) feat: trigger webhook functionality - [`7f3f6f5`](https://github.com/documenso/documenso/commit/7f3f6f531232619ee574734cca4b8a44c990f733) feat: hide secret field - [`4d6e780`](https://github.com/documenso/documenso/commit/4d6e780abe5bad00c1da183ce78b08a22c93ce2a) chore: merge main - [`a1459b4`](https://github.com/documenso/documenso/commit/a1459b41fd8f9d73f307077441142c795f04a057) Merge branch 'main' into feat/webhook-implementation - [`cd240ae`](https://github.com/documenso/documenso/commit/cd240ae8a4e29a0471c76b832891b8c07e1a09e6) chore: loading spinner ### 📊 Changes **55 files changed** (+2180 additions, -27 deletions) <details> <summary>View changed files</summary> ➕ `apps/web/src/app/(dashboard)/settings/webhooks/[id]/page.tsx` (+201 -0) ➕ `apps/web/src/app/(dashboard)/settings/webhooks/page.tsx` (+101 -0) ➕ `apps/web/src/app/(teams)/t/[teamUrl]/settings/webhooks/[id]/page.tsx` (+206 -0) ➕ `apps/web/src/app/(teams)/t/[teamUrl]/settings/webhooks/page.tsx` (+106 -0) 📝 `apps/web/src/components/(dashboard)/settings/layout/desktop-nav.tsx` (+14 -1) 📝 `apps/web/src/components/(dashboard)/settings/layout/mobile-nav.tsx` (+14 -1) ➕ `apps/web/src/components/(dashboard)/settings/webhooks/create-webhook-dialog.tsx` (+232 -0) ➕ `apps/web/src/components/(dashboard)/settings/webhooks/delete-webhook-dialog.tsx` (+172 -0) ➕ `apps/web/src/components/(dashboard)/settings/webhooks/trigger-multiselect-combobox.tsx` (+93 -0) 📝 `apps/web/src/components/(teams)/settings/layout/desktop-nav.tsx` (+15 -1) 📝 `apps/web/src/components/(teams)/settings/layout/mobile-nav.tsx` (+15 -1) ➕ `apps/web/src/components/forms/webhook.tsx` (+0 -0) ➕ `apps/web/src/pages/api/v1/me/index.ts` (+3 -0) ➕ `apps/web/src/pages/api/v1/zapier/list-documents/index.ts` (+3 -0) ➕ `apps/web/src/pages/api/v1/zapier/subscribe/index.ts` (+3 -0) ➕ `apps/web/src/pages/api/v1/zapier/unsubscribe/index.ts` (+3 -0) ➕ `apps/web/src/pages/api/webhook/trigger.ts` (+12 -0) 📝 `apps/web/src/providers/team.tsx` (+2 -2) ➕ `packages/lib/server-only/crypto/sign.ts` (+12 -0) ➕ `packages/lib/server-only/crypto/verify.ts` (+12 -0) _...and 35 more files_ </details> ### 📄 Description ## Description This PR adds support for webhooks. This feature allows users to: - Create, edit, delete webhooks - Get notified when certain events happen such as a document being created or signed (for the time being) These changes do not include the following, which are planned for a future release: - Users modifying the payload - Webhook ping test - Logs (see the latest invocations and the event trigger & payload & timestamp & webhook url for each invocation) - Cron jobs for re-trying failed invocations - Rate limiting ## Testing Performed ✅ Tested the functionality of creating/editing/deleting a webhook locally. ✅ Tested the webhook with https://webhook.site and the webhooks are triggered ## Checklist - [X] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [X] I have followed the project's coding style guidelines. ## Additional Notes - UI design needs to be refined - More testing from the reviewers and E2E tests <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Webhooks management functionality across desktop and mobile navigation with the ability to create, view, edit, and delete webhooks. - Introduced a multi-select combobox for selecting webhook trigger events. - Implemented webhook trigger functionality for document-related events (creation, sending, viewing, and completion). - Extended the `WebhookTriggerEvents` enum to include new document-related events. - Added a new `WebhookCall` table to log webhook calls, including request and response details. - Enhanced UI components, such as the `Badge` component, to support different sizes. - **Bug Fixes** - N/A - **Documentation** - N/A - **Refactor** - Refactored document update logic to trigger webhooks post-update. - **Style** - N/A - **Tests** - N/A - **Chores** - Performed database migrations to support new webhook functionalities and schema changes. - **Revert** - N/A <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1245
No description provided.