By default, you can use Dynamics credentials to send SMS messages to your users. However, if you want to send beyond US & Canada, you will need to set up your own Twilio account. In order to do this, you toggle off “Use Dynamic’s credentials” and a section will open up for you, where you can enter your own credentials.
When you enable SMS sign-up, you can also enable embedded wallets for your users. This means that when a user signs up with their phone number, they will also receive a wallet that they can use to interact with your application.In order to ensure your end users are adequately protected against attacks like sim swaps, we highly encourage you to enable account MFA (TOTP) via Google Authenticator.
You can trigger Email and SMS signup/login using the Dynamic UI simply by calling the method to trigger the signup/login flow:
Copy
Ask AI
dynamicClient.ui.auth.show()
After the user has signed in successfully, you can also bring up our user profile interface, which allows your user
to view their wallet’s address and balance, as well as editing their fields like email and phone number.To show the user profile modal, call:
The dynamic client authentication module enables user authentication via email or SMS. There are two steps - send then verify the OTP. After this point, the user will be logged in.
The methods below can be used to send/resend one time passwords
Copy
Ask AI
// Send, retry and then verify OTP to an emailawait dynamicClient.auth.email.sendOTP('[email protected]')await dynamicClient.auth.email.resendOTP()// Send OTP to a phone number with retryawait dynamicClient.auth.sms.sendOTP({ dialCode: '1', iso2: 'us', phone: '2793334444',})await dynamicClient.auth.sms.resendOTP()
The example below demonstrates a React component that can send, resend and verify OTPs through email.You can follow the same pattern for phone numbers but collect phone number, iso2 and dial code instead
of email address.