-
Notifications
You must be signed in to change notification settings - Fork 619
prefer explicit clientId over secretKey computation #6188
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
prefer explicit clientId over secretKey computation #6188
Conversation
🦋 Changeset detectedLatest commit: 64d7bf3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
size-limit report 📦
|
74e6548 to
150581c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6188 +/- ##
=======================================
Coverage 56.87% 56.88%
=======================================
Files 1155 1155
Lines 63988 63988
Branches 5200 5193 -7
=======================================
+ Hits 36395 36399 +4
+ Misses 26865 26862 -3
+ Partials 728 727 -1
*This pull request uses carry forward flags. Click here to find out more.
|
Merge activity
|
TOOL-0000
### TL;DR
Prioritize explicitly passed `clientId` over computed values when creating a Thirdweb client.
### What changed?
Modified the client initialization logic to prefer explicitly passed `clientId` parameters over computing them from `secretKey`. Only falls back to computing the `clientId` from `secretKey` when no explicit `clientId` is provided.
### How to test?
1. Create a Thirdweb client with both `clientId` and `secretKey` parameters
2. Verify that the provided `clientId` is used instead of computing one from the `secretKey`
3. Create a client with only `secretKey` and verify the `clientId` is computed correctly
### Why make this change?
To give developers more control over client configuration by respecting explicitly provided parameters rather than always computing values from the secret key. This allows for more flexible client setup scenarios where the computed `clientId` might not be desired.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR updates the behavior of the `createThirdwebClient()` function to prioritize the explicitly provided `clientId` over deriving it from the `secretKey`. It also modifies the corresponding test to reflect this new behavior.
### Detailed summary
- Updated `createThirdwebClient()` to prefer `clientId` over computed value from `secretKey`.
- Changed test description to indicate `clientId` is not ignored when `secretKey` is provided.
- Updated test expectation to check that `clientId` is equal to the explicitly provided value instead of the computed one.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
150581c to
64d7bf3
Compare

TOOL-0000
TL;DR
Prioritize explicitly passed
clientIdover computed values when creating a Thirdweb client.What changed?
Modified the client initialization logic to prefer explicitly passed
clientIdparameters over computing them fromsecretKey. Only falls back to computing theclientIdfromsecretKeywhen no explicitclientIdis provided.How to test?
clientIdandsecretKeyparametersclientIdis used instead of computing one from thesecretKeysecretKeyand verify theclientIdis computed correctlyWhy make this change?
To give developers more control over client configuration by respecting explicitly provided parameters rather than always computing values from the secret key. This allows for more flexible client setup scenarios where the computed
clientIdmight not be desired.PR-Codex overview
This PR updates the behavior of the
createThirdwebClient()function to prioritize the explicitclientIdover a computedclientIdderived from thesecretKey. It also adjusts the related test cases to reflect this new behavior.Detailed summary
client.tsto prefer the providedclientIdover computing it fromsecretKey.client.test.tsto clarify thatclientIdwill not be ignored ifsecretKeyis provided.clientIdinstead of the computed value.