This guide will help you to create a completely headless sign-in with email, using Dynamic OTP.
- Create an email verification
You will be using the emailVerifications endpoint to create a new email verification. This will send an email to the user with a One Time Password so they can verify their email address.
The link for this endpoint lives here. Visit it to make mock requests and see what parameters are required. are used.
- Verify the OTP
To verify the OTP, the next call will be to signIn endpoint, which you can find here. You will need to pass the OTP from the email and the verificationUUID from the previous response.
You will pass in the verificationUUID and the OTP from the email to the signIn endpoint. This will return a JWT that you can use to authenticate the user.
- Get the JWT
At this point, you’ll have a JWT returned from the verify call, which will be tied to a session in Dynamic, and we return details of the user from that JWT.
Learn more about the JWT object here.
That’s it! You now have a completely headless sign-in with email, using Dynamic OTP.