@dynamic-labs/sdk-react-core 4.90.0 → 4.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -52
  3. package/package.cjs +2 -2
  4. package/package.js +2 -2
  5. package/package.json +13 -13
  6. package/src/lib/client/extension/functions/getSessionKeys/getSessionKeys.cjs +11 -0
  7. package/src/lib/client/extension/functions/getSessionKeys/getSessionKeys.js +7 -0
  8. package/src/lib/client/extension/functions/getSessionPublicKey/getSessionPublicKey.cjs +17 -0
  9. package/src/lib/client/extension/functions/getSessionPublicKey/getSessionPublicKey.d.ts +7 -0
  10. package/src/lib/client/extension/functions/getSessionPublicKey/getSessionPublicKey.js +13 -0
  11. package/src/lib/client/extension/index.d.ts +1 -0
  12. package/src/lib/context/DynamicContext/DynamicContext.cjs +9 -1
  13. package/src/lib/context/DynamicContext/DynamicContext.js +10 -2
  14. package/src/lib/styles/index.shadow.cjs +1 -1
  15. package/src/lib/styles/index.shadow.js +1 -1
  16. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.cjs +12 -0
  17. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.js +12 -0
  18. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +7 -3
  19. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +7 -3
  20. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +16 -3
  21. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +3 -1
  22. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +16 -3
  23. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +8 -1
  24. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.d.ts +1 -1
  25. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +8 -1
  26. package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +8 -0
  27. package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +8 -0
  28. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.cjs +56 -13
  29. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.js +58 -15
  30. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.cjs +40 -2
  31. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.d.ts +7 -0
  32. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.js +41 -3
  33. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -0
  34. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,21 @@
1
1
 
2
+ ## [4.91.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.90.0...v4.91.0) (2026-06-23)
3
+
4
+
5
+ ### Features
6
+
7
+ * **midnight:** add WaaS layer to @dynamic-labs/midnight ([#11006](https://github.com/dynamic-labs/dynamic-auth/issues/11006)) ([01b9d16](https://github.com/dynamic-labs/dynamic-auth/commit/01b9d16d0ba92a141a9be546ca00cca4029894d5))
8
+ * **sdk-react-core:** widget support for Midnight multi-address display + export hiding ([#11008](https://github.com/dynamic-labs/dynamic-auth/issues/11008)) ([87320b4](https://github.com/dynamic-labs/dynamic-auth/commit/87320b4d6e286b88e17f144641346e16a27e9e71))
9
+ * **waas:** wire session public key through host backup ops for keyshare diagnostics [DYNT-1280] ([#11675](https://github.com/dynamic-labs/dynamic-auth/issues/11675)) ([4f7981c](https://github.com/dynamic-labs/dynamic-auth/commit/4f7981c009930469dec7b3dec93f20f99bbe5498))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **ethereum-aa:** make ZeroDevConnector inert instead of throwing when ZeroDev config is absent ([#11610](https://github.com/dynamic-labs/dynamic-auth/issues/11610)) ([a3aab6a](https://github.com/dynamic-labs/dynamic-auth/commit/a3aab6a97e2e996f96b725f9336704b844f79603))
15
+ * **react-native-extension:** fall back to react-native-webview when embedded native module is unavailable ([#11683](https://github.com/dynamic-labs/dynamic-auth/issues/11683)) ([3f8d92c](https://github.com/dynamic-labs/dynamic-auth/commit/3f8d92ca0c327128b16e3355ab2f4e63d2c8e731))
16
+ * **sdk-react-core:** warn instead of throwing when ZeroDev connector is absent ([#11611](https://github.com/dynamic-labs/dynamic-auth/issues/11611)) ([5836252](https://github.com/dynamic-labs/dynamic-auth/commit/58362524e45205399c0fdc5b92414190d1929e0b))
17
+ * **waas-evm:** sign EOA transactions with the resolved chainId, not the connector default ([#11653](https://github.com/dynamic-labs/dynamic-auth/issues/11653)) ([e634098](https://github.com/dynamic-labs/dynamic-auth/commit/e634098f0f23f4c53f92a580db6f4aacbd6b1f92))
18
+
2
19
  ## [4.90.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.89.0...v4.90.0) (2026-06-19)
3
20
 
4
21
 
package/README.md CHANGED
@@ -1,54 +1,3 @@
1
1
  # Dynamic Labs' React SDK
2
2
 
3
- ![Demo](https://user-images.githubusercontent.com/1596208/224532010-75f90ab4-6151-4e07-8452-fbef87b6a210.jpg)
4
-
5
- Welcome to Dynamic! We're so excited that you're here!
6
-
7
- ## What is Dynamic?
8
-
9
- Dynamic offers smart and beautiful login flows for crypto-native users, simple onboarding flows for everyone else, and powerful developer tools that go beyond authentication.
10
-
11
- ## Product walkthrough
12
-
13
- Want a quick overview of some of the powerful features Dynamic offers? check out our product walkthrough video below.
14
-
15
- <a href="https://www.youtube.com/watch?v=LKP-aJOTxfw
16
- " target="_blank"><img src="https://user-images.githubusercontent.com/1596208/224676777-5f6ffad2-f2c3-4f49-bc4e-a8643da777cd.jpg"
17
- alt="Product walkthrough video" width="1280" /></a>
18
-
19
- ## Getting started
20
-
21
- Getting started with Dynamic is simple, and [you can read the full guide here](https://docs.dynamic.xyz/docs/getting-started-with-dynamic).
22
-
23
- Here is a shoterned version of the getting started guide:
24
-
25
- 1. [Create your Dynamic account and grab an Environment ID](https://app.dynamic.xyz).
26
- 2. Install this npm package
27
- 3. Configure the SDK
28
-
29
- ```js
30
- import {
31
- DynamicContextProvider,
32
- DynamicWidget,
33
- } from '@dynamic-labs/sdk-react-core';
34
-
35
- const App = () => (
36
- <DynamicContextProvider
37
- settings={{
38
- environmentId: 'ID',
39
- }}
40
- >
41
- <DynamicWidget />
42
- </DynamicContextProvider>
43
- );
44
-
45
- export default App;
46
- ```
47
-
48
- ## Feedback
49
-
50
- Dynamic strives to help you build innovative experiences, meaning we're always adding new features. You can [Join our Slack community](https://www.dynamic.xyz/slack)., [follow us on twitter](https://twitter.com/dynamic_xyz) or check out our [change log](https://www.dynamic.xyz/changelog) to see the latest and greatest from us.
51
-
52
- ## Documentation
53
-
54
- **Get started [here](https://docs.dynamic.xyz/docs).**
3
+ > **Use our new SDK:** This package is part of our legacy SDK. The recommended approach to implement Dynamic in React is to use our new JavaScript SDK together with our React hooks library. See the [React Quickstart guide](https://www.dynamic.xyz/docs/javascript/reference/react-quickstart) to get started.
package/package.cjs CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.90.0";
6
+ var version = "4.91.0";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.1046",
9
9
  "@dynamic-labs-sdk/client": "1.12.1",
10
- "@dynamic-labs-wallet/browser-wallet-client": "1.0.42",
10
+ "@dynamic-labs-wallet/browser-wallet-client": "1.0.44",
11
11
  "@dynamic-labs-wallet/forward-mpc-client": "0.12.0",
12
12
  "@hcaptcha/react-hcaptcha": "1.4.4",
13
13
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
package/package.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use client'
2
- var version = "4.90.0";
2
+ var version = "4.91.0";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.1046",
5
5
  "@dynamic-labs-sdk/client": "1.12.1",
6
- "@dynamic-labs-wallet/browser-wallet-client": "1.0.42",
6
+ "@dynamic-labs-wallet/browser-wallet-client": "1.0.44",
7
7
  "@dynamic-labs-wallet/forward-mpc-client": "0.12.0",
8
8
  "@hcaptcha/react-hcaptcha": "1.4.4",
9
9
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.90.0",
3
+ "version": "4.91.0",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.1046",
6
6
  "@dynamic-labs-sdk/client": "1.12.1",
7
- "@dynamic-labs-wallet/browser-wallet-client": "1.0.42",
7
+ "@dynamic-labs-wallet/browser-wallet-client": "1.0.44",
8
8
  "@dynamic-labs-wallet/forward-mpc-client": "0.12.0",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
@@ -17,17 +17,17 @@
17
17
  "yup": "0.32.11",
18
18
  "react-international-phone": "4.5.0",
19
19
  "bs58": "5.0.0",
20
- "@dynamic-labs/assert-package-version": "4.90.0",
21
- "@dynamic-labs/iconic": "4.90.0",
22
- "@dynamic-labs/locale": "4.90.0",
23
- "@dynamic-labs/logger": "4.90.0",
24
- "@dynamic-labs/multi-wallet": "4.90.0",
25
- "@dynamic-labs/rpc-providers": "4.90.0",
26
- "@dynamic-labs/store": "4.90.0",
27
- "@dynamic-labs/types": "4.90.0",
28
- "@dynamic-labs/utils": "4.90.0",
29
- "@dynamic-labs/wallet-book": "4.90.0",
30
- "@dynamic-labs/wallet-connector-core": "4.90.0",
20
+ "@dynamic-labs/assert-package-version": "4.91.0",
21
+ "@dynamic-labs/iconic": "4.91.0",
22
+ "@dynamic-labs/locale": "4.91.0",
23
+ "@dynamic-labs/logger": "4.91.0",
24
+ "@dynamic-labs/multi-wallet": "4.91.0",
25
+ "@dynamic-labs/rpc-providers": "4.91.0",
26
+ "@dynamic-labs/store": "4.91.0",
27
+ "@dynamic-labs/types": "4.91.0",
28
+ "@dynamic-labs/utils": "4.91.0",
29
+ "@dynamic-labs/wallet-book": "4.91.0",
30
+ "@dynamic-labs/wallet-connector-core": "4.91.0",
31
31
  "eventemitter3": "5.0.1"
32
32
  },
33
33
  "devDependencies": {
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var client = require('@dynamic-labs-sdk/client');
7
+ var core = require('@dynamic-labs-sdk/client/core');
8
+
9
+ const getSessionKeys = () => core.getSessionKeys(client.getDefaultClient());
10
+
11
+ exports.getSessionKeys = getSessionKeys;
@@ -0,0 +1,7 @@
1
+ 'use client'
2
+ import { getDefaultClient } from '@dynamic-labs-sdk/client';
3
+ import { getSessionKeys as getSessionKeys$1 } from '@dynamic-labs-sdk/client/core';
4
+
5
+ const getSessionKeys = () => getSessionKeys$1(getDefaultClient());
6
+
7
+ export { getSessionKeys };
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../../../../_virtual/_tslib.cjs');
7
+ var getSessionKeys = require('../getSessionKeys/getSessionKeys.cjs');
8
+
9
+ /**
10
+ * Resolves the session public key the client signs session chaining nonces
11
+ * with. Forwarded to the keyshare service on backup so a signature failure can
12
+ * be logged against the JWT-embedded key. Nonce-free; undefined before a
13
+ * session key exists.
14
+ */
15
+ const getSessionPublicKey = () => _tslib.__awaiter(void 0, void 0, void 0, function* () { var _a; return (_a = getSessionKeys.getSessionKeys()) === null || _a === void 0 ? void 0 : _a.publicKey; });
16
+
17
+ exports.getSessionPublicKey = getSessionPublicKey;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolves the session public key the client signs session chaining nonces
3
+ * with. Forwarded to the keyshare service on backup so a signature failure can
4
+ * be logged against the JWT-embedded key. Nonce-free; undefined before a
5
+ * session key exists.
6
+ */
7
+ export declare const getSessionPublicKey: () => Promise<string | undefined>;
@@ -0,0 +1,13 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../../../../_virtual/_tslib.js';
3
+ import { getSessionKeys } from '../getSessionKeys/getSessionKeys.js';
4
+
5
+ /**
6
+ * Resolves the session public key the client signs session chaining nonces
7
+ * with. Forwarded to the keyshare service on backup so a signature failure can
8
+ * be logged against the JWT-embedded key. Nonce-free; undefined before a
9
+ * session key exists.
10
+ */
11
+ const getSessionPublicKey = () => __awaiter(void 0, void 0, void 0, function* () { var _a; return (_a = getSessionKeys()) === null || _a === void 0 ? void 0 : _a.publicKey; });
12
+
13
+ export { getSessionPublicKey };
@@ -19,6 +19,7 @@ export { hasElevatedAccessToken } from './functions/hasElevatedAccessToken';
19
19
  export { generateChainingSignature } from './functions/generateChainingSignature/generateChainingSignature';
20
20
  export { generateSessionKeys } from './functions/generateSessionKeys/generateSessionKeys';
21
21
  export { getSessionKeys } from './functions/getSessionKeys/getSessionKeys';
22
+ export { getSessionPublicKey } from './functions/getSessionPublicKey/getSessionPublicKey';
22
23
  export { getClientSessionNonceHeaders } from './functions/getClientSessionNonceHeaders/getClientSessionNonceHeaders';
23
24
  export { useInitStatus } from './initStatus/useInitStatus';
24
25
  export { setUnverifiedWalletAccounts } from './unverifiedWalletAccounts/setUnverifiedWalletAccounts';
@@ -347,7 +347,12 @@ const InnerDynamicContextProvider = (props) => {
347
347
  //selected wallet to perform an action (become primary, unlink, etc)
348
348
  const [selectedWalletWithAction, setSelectedWalletWithAction] = React.useState(null);
349
349
  useSetWalletConnectorVerifiedCredentials.useSetWalletConnectorVerifiedCredentials(user !== null && user !== void 0 ? user : userWithMissingInfo, walletConnectorOptions);
350
- useSetWalletConnectorFetchers.useSetWalletConnectorFetchers(walletConnectorOptions, environmentId, projectSettings);
350
+ // handleLogOutWithReason is created later in this component (via useHandleLogout),
351
+ // but useSetWalletConnectorFetchers needs a logout callback now. Bridge the two
352
+ // with a ref: the WaaS connector only invokes onUnauthorized at runtime (when
353
+ // the iframe reports a 401), by which point the ref is populated.
354
+ const handleLogOutWithReasonRef = React.useRef();
355
+ useSetWalletConnectorFetchers.useSetWalletConnectorFetchers(walletConnectorOptions, environmentId, projectSettings, () => { var _a; return (_a = handleLogOutWithReasonRef.current) === null || _a === void 0 ? void 0 : _a.call(handleLogOutWithReasonRef, 'session-refresh-unauthorized'); });
351
356
  const { primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, wallets: linkedOrConnectedWallets, } = useWalletConnectors.useWalletConnectors({
352
357
  canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
353
358
  connectedWallets,
@@ -403,6 +408,9 @@ const InnerDynamicContextProvider = (props) => {
403
408
  environmentId,
404
409
  handleLogOutWithReason,
405
410
  });
411
+ // Keep the ref current so the WaaS connector's onUnauthorized callback always
412
+ // calls the latest logout handler.
413
+ handleLogOutWithReasonRef.current = handleLogOutWithReason;
406
414
  // For some reason, calling useNonce in useGlobalLoading causes errors
407
415
  const nonce$1 = nonce.useNonce();
408
416
  const sdkHasLoaded = useGlobalLoading.useGlobalLoading({
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../_virtual/_tslib.js';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
- import { createContext, useEffect, useState, useMemo, useCallback } from 'react';
4
+ import { createContext, useEffect, useState, useMemo, useRef, useCallback } from 'react';
5
5
  import { I18nextProvider } from 'react-i18next';
6
6
  import { getIconicSpriteUrl } from '@dynamic-labs/iconic';
7
7
  import { Logger } from '@dynamic-labs/logger';
@@ -343,7 +343,12 @@ const InnerDynamicContextProvider = (props) => {
343
343
  //selected wallet to perform an action (become primary, unlink, etc)
344
344
  const [selectedWalletWithAction, setSelectedWalletWithAction] = useState(null);
345
345
  useSetWalletConnectorVerifiedCredentials(user !== null && user !== void 0 ? user : userWithMissingInfo, walletConnectorOptions);
346
- useSetWalletConnectorFetchers(walletConnectorOptions, environmentId, projectSettings);
346
+ // handleLogOutWithReason is created later in this component (via useHandleLogout),
347
+ // but useSetWalletConnectorFetchers needs a logout callback now. Bridge the two
348
+ // with a ref: the WaaS connector only invokes onUnauthorized at runtime (when
349
+ // the iframe reports a 401), by which point the ref is populated.
350
+ const handleLogOutWithReasonRef = useRef();
351
+ useSetWalletConnectorFetchers(walletConnectorOptions, environmentId, projectSettings, () => { var _a; return (_a = handleLogOutWithReasonRef.current) === null || _a === void 0 ? void 0 : _a.call(handleLogOutWithReasonRef, 'session-refresh-unauthorized'); });
347
352
  const { primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, wallets: linkedOrConnectedWallets, } = useWalletConnectors({
348
353
  canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
349
354
  connectedWallets,
@@ -399,6 +404,9 @@ const InnerDynamicContextProvider = (props) => {
399
404
  environmentId,
400
405
  handleLogOutWithReason,
401
406
  });
407
+ // Keep the ref current so the WaaS connector's onUnauthorized callback always
408
+ // calls the latest logout handler.
409
+ handleLogOutWithReasonRef.current = handleLogOutWithReason;
402
410
  // For some reason, calling useNonce in useGlobalLoading causes errors
403
411
  const nonce = useNonce();
404
412
  const sdkHasLoaded = useGlobalLoading({