HTML – Sign in with Email/Phone
Easily add email and phone number verification using Cotter's SDK. Send a magic link to your users via email, SMS or WhatsApp in just a few lines of code.
Last updated
Easily add email and phone number verification using Cotter's SDK. Send a magic link to your users via email, SMS or WhatsApp in just a few lines of code.
Last updated
Cotter's Magic Link authenticates your user using a link. It allows seamless, fast, and secure way for your user to login to your Web App. Follow this simple guide to see how it works!
To follow this guide, let's use our Hello World Template in CodeSandbox!
Copy the following script to the head section of your HTML page
div
with id cotter-form-container
element to contain cotter's formPlease note that id has to be cotter-form-container
for the form to show up.
You need your API_KEY_ID for this step. Create a developer account and create a Project to get your API keys. The API Keys will only be shown once!
Grab your API_KEY_ID
from the dashboard, then replace <YOUR_API_KEY_ID>
with your API_KEY_ID
.
🎉 You're done! Now that you know how it works on the client side, let's check out how to process Cotter's payload in your backend so you can start registering and logging in users in your backend server.
Here's a fully working example of the guide we went over.
To send code/link via SMS or WhatsApp, you'll need to add some balance to you project in the Dashboard.
You can customize the form from the Dashboard > Branding. You can also add Custom CSS.
Add Additional Fields like Name, Address, etc to the login form.
When the user successfully authenticated, send Cotter's response to your backend to either create a new user or log the user in. Learn how to send Cotter's response and verify it in your backend: