Skip to content

[Dashboard] Add webhook version support to Universal Bridge #6779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Apr 20, 2025


PR-Codex overview

This PR focuses on enhancing the webhook functionality and fee configuration in the universal-bridge section of the dashboard. It introduces new API integrations for managing webhooks and developer fees, while streamlining the related UI components.

Detailed summary

  • Removed unnecessary props from <PayWebhooksPage /> in page.tsx.
  • Added developerFeeBPS validation in validations.ts.
  • Integrated getFees API call in page.tsx to fetch fee details.
  • Updated <PayConfig /> to include fees prop and modified form handling for fees.
  • Added new API functions for managing webhooks in developer.ts.
  • Updated <PayWebhooksPage /> to use getWebhooks instead of deprecated server proxy.
  • Enhanced webhook creation UI to include version selection and secret key management.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Apr 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2025 0:45am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Apr 22, 2025 0:45am
login ⬜️ Skipped (Inspect) Apr 22, 2025 0:45am
thirdweb_playground ⬜️ Skipped (Inspect) Apr 22, 2025 0:45am
wallet-ui ⬜️ Skipped (Inspect) Apr 22, 2025 0:45am

@vercel vercel bot temporarily deployed to Preview – login April 20, 2025 08:25 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 20, 2025 08:25 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 20, 2025 08:25 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 20, 2025 08:25 Inactive
Copy link

changeset-bot bot commented Apr 20, 2025

⚠️ No Changeset found

Latest commit: e116517

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Apr 20, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review April 20, 2025 08:25
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges requested review from a team as code owners April 20, 2025 08:25
Copy link

codecov bot commented Apr 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.18%. Comparing base (d7dc83f) to head (e116517).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6779      +/-   ##
==========================================
- Coverage   55.18%   55.18%   -0.01%     
==========================================
  Files         896      896              
  Lines       56934    56940       +6     
  Branches     3944     3943       -1     
==========================================
  Hits        31420    31420              
- Misses      25418    25424       +6     
  Partials       96       96              
Flag Coverage Δ
packages 55.18% <ø> (-0.01%) ⬇️

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Apr 20, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 50.73 KB (0%) 1.1 s (0%) 235 ms (+47.97% 🔺) 1.3 s
thirdweb (cjs) 138.79 KB (0%) 2.8 s (0%) 471 ms (+15.19% 🔺) 3.3 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 47 ms (+222.84% 🔺) 159 ms
thirdweb/chains (tree-shaking) 514 B (0%) 11 ms (0%) 37 ms (+789.84% 🔺) 47 ms
thirdweb/react (minimal + tree-shaking) 19.41 KB (0%) 389 ms (0%) 101 ms (+283.32% 🔺) 489 ms

@joaquim-verges joaquim-verges force-pushed the _Dashboard_Add_webhook_version_support_to_Universal_Bridge branch from 935b3b4 to 766b105 Compare April 20, 2025 08:39
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 20, 2025 08:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 20, 2025 08:39 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 20, 2025 08:39 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 20, 2025 08:39 Inactive
Copy link
Member

@jnsdls jnsdls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a small nit

Purchase Complete
</SelectItem>
<SelectItem value="v2">v2</SelectItem>
<SelectItem value="v1">v1</SelectItem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, if the field is called version then having v in the version feels odd

@vercel vercel bot temporarily deployed to Preview – login April 21, 2025 21:16 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 21, 2025 21:16 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 21, 2025 21:16 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 21, 2025 21:16 Inactive
Comment on lines +117 to +123
developerFeeBPS: z
.string()
.transform((val) => Number(val))
.refine((val) => val >= 0 && val <= 100, {
message: "Developer fee must be between 0 and 100",
})
.optional(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validation for developerFeeBPS currently transforms string inputs to numbers but doesn't properly handle empty strings, which would become NaN and fail validation. Consider either:

  1. Adding a pre-transform check:
.transform((val) => val === "" ? undefined : Number(val))
  1. Or using a more robust approach with preprocess:
z.preprocess(
  (val) => val === "" ? undefined : Number(val),
  z.number().min(0).max(100).optional()
)

This would ensure empty inputs are properly handled as optional values rather than failing validation.

Suggested change
developerFeeBPS: z
.string()
.transform((val) => Number(val))
.refine((val) => val >= 0 && val <= 100, {
message: "Developer fee must be between 0 and 100",
})
.optional(),
developerFeeBPS: z
.preprocess(
(val) => val === "" ? undefined : Number(val),
z.number().min(0).max(100).optional()
),

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@vercel vercel bot temporarily deployed to Preview – docs-v2 April 21, 2025 22:51 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 21, 2025 22:51 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 21, 2025 22:51 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 21, 2025 22:51 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 21, 2025 23:37 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 21, 2025 23:37 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 21, 2025 23:37 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 21, 2025 23:37 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 22, 2025 00:13 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 22, 2025 00:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 22, 2025 00:13 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 22, 2025 00:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 22, 2025 00:18 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 22, 2025 00:18 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 22, 2025 00:18 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 22, 2025 00:18 Inactive
@vercel vercel bot temporarily deployed to Preview – login April 22, 2025 00:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui April 22, 2025 00:39 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 April 22, 2025 00:39 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground April 22, 2025 00:39 Inactive
@joaquim-verges joaquim-verges merged commit 7965d93 into main Apr 22, 2025
24 checks passed
@joaquim-verges joaquim-verges deleted the _Dashboard_Add_webhook_version_support_to_Universal_Bridge branch April 22, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants