Skip to content

Commit 74e6548

Browse files
committed
prefer explicit clientId over secretKey computation
1 parent ee57ded commit 74e6548

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/wicked-chairs-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
when explicitly passing `clientId` to `createThirdwebClient()` prefer it over computing the `clientId` from a passed `secretKey` option

packages/thirdweb/src/client/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export function createThirdwebClient(
114114
throw new Error("clientId must be provided when using a JWT secretKey");
115115
}
116116
} else {
117-
realClientId = computeClientIdFromSecretKey(secretKey);
117+
// always PREFER the clientId if provided, only compute it from the secretKey if we don't have a clientId passed explicitly
118+
realClientId = clientId ?? computeClientIdFromSecretKey(secretKey);
118119
}
119120
}
120121

0 commit comments

Comments
 (0)