Overview
Leveraging Dynamicâs React package, this guide will help you create a sign in / sign up flow based on an sms login form. We use theuseConnectWithOtp
hook to expose two methods: connectWithSms
and verifyOneTimePassword
.
The first method will send an SMS to the userâs phone number, and the second will verify the OTP sent to the userâs phone.
Once thatâs done, the user will be authenticated and you can access their information through the useDynamicContext
hook!
Dashboard Setup
SMS Signup/Login
The first thing youâll want to do is create a new Dynamic organization and setup Dashboard.- Sign up at app.dynamic.xyz
- Fill in the modal to create your organization and project.
- Under the Developer menu, go to SDK & APIs and fetch the Environment ID. Keep this as weâll need this key in a little bit.
For more information on how to configure SMS signup/login, check out our SMS Signup/Login guide.
Configuring the SDK
Letâs start by installing our packages. Follow our Quickstart guide for a detailed walkthrough. When youâre done, weâll update our App.js to include our environment ID in the setup and import theDynamicContextProvider
and EthereumWalletConnectors
.
You app.js file should look like this (note that we are only importing the EthereumWalletConnectors for now):
SMS Signup/Login UI
Now that we have our environment, we can create our SMS signup/login form. We use theuseConnectWithOtp
hook to handle the SMS setup.