React – WebAuthn
Sign in users faster using WebAuthn: sign in with TouchID or Windows Hello from a web browser.
Cotter's WebAuthn authenticates your user using either TouchID or Windows Hello from their browser. This means it works from your website. 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!
Try it live on our Example Next.js Project. Check out the complete code on Github.
Step 1: Import Cotter as a dependency
(This feature is available on version >= 0.3.4)
Step 2: Initialize Cotter and Show the Form
Create a free account and go to the dashboard to get your API_KEY_ID
.
Import Cotter
Call
signInWithWebAuthnOrLink
to use WebAuthn with fallback Magic Link, followed byshowEmailForm
orshowPhoneForm
, and get the response as a promise.Setup a
<div>
withid="cotter-form-container"
that will contain the form.
🎉 You're done!
✏️ Ready to setup & customize your login?
Customize the Form
Easily customize the form from Cotter's Dashboard > Branding.
Full JS SDK Reference
Sign In with WebAuthn👉 What's Next?
Customize the Form
You can customize the form from the Dashboard > Branding. You can also add Custom CSS.
Add Additional Fields
Add Additional Fields like Name, Address, etc to the login form.
Register User to your Backend
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:
Backend: Handling ResponseLast updated