Below are the breaking changes in V4 so far. If you don’t see anything you’ll be affected by, you can skip this guide and simply update your SDK package to the latest V4. Just make sure to also upgrade all your other dynamic packages too!
We upgraded to Starknet v6 See this guide for more details: https://starknetjs.com/docs/guides/migrate/There are no code changes required on the Dynamic SDK side, however if you have installed the starknet package, you will need to upgrade to >= v6.11.0.
In V2, we deprecated the eventsCallbacks prop on the DynamicContextProvider in favour of a prop called events which has the same purpose. In V4 we are removing the old prop entirely.
In V4 we stopped exporting authToken and minAuthToken from the dynamic context. You can still get these values by calling getAuthToken and getMinAuthToken.
Note that if you just want to know if the user is logged in or not, you can use the useIsLoggedIn hook.
In V4, we changed the openFunding method exported from useFunding hook to openExternalFunding which now takes in a required parameter of onrampProvider.
useDynamicEvents which allows you to listen to events emitted by the SDK now exposes more events. The full list of available events is now:Auth Events
authFailure
authFlowCancelled
authFlowClose
authFlowOpen
authInit
logoutWallet Events
walletAdded
walletRemoved
embeddedWalletCreated
primaryWalletChanged
primaryWalletNetworkChanged
userWalletsChangedOTP/MFA Events
emailVerificationResult
smsVerificationResult
mfaCompletionFailure
mfaCompletionSuccess