Guide for migrating from Para version 1.x to Para’s version 2.0 alpha release
setup-para
CLI tool needs to run before running your app to ensure all @getpara
libraries are properly polyfilled. It is recommended to do this in your postinstall
step of your package.json
, something like:
ParaProvider
is now required to be used when using the @getpara/react-sdk
queryClient
from @tanstack/react-query
must be provided.
@tanstack/react-query
docs for more information on setting up a QueryClient
appName
prop has moved from a modal prop to a required config prop on the ParaProvider
. This name will be used throughout the modal and in any external wallet providers that may be used.
ParaModal
no longer needs to be provided separately, it is automatically included with the ParaProvider
and all modal props can be passed to the ParaProvider
.
ParaModal
can still be provided separately if that is preferred. In this case the disableEmbeddedModal: true
value should be passed to the ParaProvider
config.ParaModal
props, isOpen
and onClose
, are no longer required (though they can be provided if desired). These values are now handled by the ParaProvider
and developers can use the useModal
hook to control the modal state.
ParaProvider
.
ParaModal
component you are providing and use the modal that the updated ParaProvider
provides. This option offers the most code reduction and overall simpler developer experience.ParaModal
component you are providing in your app. This option is a bit quicker than the first but will lead to a poorer developer experience.<ParaModal>
and use the one built into <ParaProvider>
.
Starting Code:ParaProvider
and the connectors will be instantiated for you. Assuming you already followed the migration steps above, a successful migration would look like:
wallets
value in the externalWalletConfig
evmConnector
config needs to be passed, the other connectors will be skipped in that case.+
and containing only numbers without spaces or extra characters, i.e.: +${number}
. If your UI deals in separated country codes and national phone numbers, you may use the exported formatPhoneNumber
function to combine them into a correctly formatted string.@getpara/web-sdk
@alpha@getpara/react-sdk
@alpha@getpara/react-native-sdk
@alphawaitForLogin
, you may now pass a callback that is invoked on each polling interval, as well as a callback to indicate whether the method should be canceled and another invoked upon cancelation.
Authentication Methods
checkIfUserExists
initiateUserLogin
createUser
checkIfUserExistsByPhone
initiateUserLoginForPhone
createUserByPhone
signUpOrLogIn
signUpOrLogIn
method as detailed on our Custom Authentication UI page.Authentication Polling
waitForLoginAndSetup
waitForAccountCreation
waitForPasskeyAndCreateWallet
waitForLogin
waitForSignup
waitForWalletCreation
Pregen Wallet Methods
Farcaster Methods
initiateFarcasterLogin
waitForFarcasterStatus
verifyFarcaster
verifyFarcaster
method as detailed on our Custom Authentication UI page.OAuth Methods
getOAuthUrl
waitForOAuth
verifyOAuth
verifyOAuth
method as detailed on our Custom Authentication UI page.Session Methods
2FA Methods
check2FAStatus
(Deprecated)enable2FA
verify2FA
setup2FA
setup2fa
(Replaces check2FAStatus
)enable2fa
verify2fa
check2FAStatus
with setup2fa
, which will now either return { isSetup: true }
or { isSetup: false, uri: string }
depending on the current user’s settings