Overview
The OTP Link feature provides a secure verification method by sending clickable links via WhatsApp. Unlike traditional OTP codes, this approach allows users to verify their identity with a single tap, creating a smoother user experience while maintaining security.How It Works
- Your application requests an OTP link to be sent to a user’s WhatsApp
- CrunchzApp generates a unique verification link and delivers it via WhatsApp
- The user clicks the link, which opens in their browser
- Upon successful verification, the user is redirected to your application or a callback URL is triggered
Available Methods
Basic Link Request
Send a standard verification link to a WhatsApp contact.By default, OTP links expire after 15 minutes and use a standard verification message.
Custom Link Request
Create a fully customized verification experience with custom prompts, messages, and callbacks.When using custom codes in your response messages, ensure they are properly formatted and highlighted (as shown with the ##code## syntax in the example).
Customization Options
Custom Prompts
Custom Prompts
The
prompt()
method allows you to customize the text shown to users when they click the verification link. This can be used to provide context about why they’re being asked to verify.Custom Response Messages
Custom Response Messages
The
responseMessage()
method lets you define custom messages for different verification outcomes:successResponse
: Shown after successful verificationfailedResponse
: Shown after failed verificationexpiredResponse
: Shown when the link has expired
Callback URLs
Callback URLs
The
callback()
method allows you to specify webhook URLs that will be called when verification succeeds or fails:successCallback
: Called on successful verificationfailedCallback
: Called on failed verification
Common Use Cases
Passwordless Login
Passwordless Login
Send a verification link to users instead of requiring them to remember and enter passwords.
Account Recovery
Account Recovery
Provide a secure way for users to regain access to their accounts without complex recovery processes.
Secure Actions Confirmation
Secure Actions Confirmation
Verify user intent for sensitive operations like payments or account changes with a simple click.
Two-Factor Authentication
Two-Factor Authentication
Add an extra layer of security by requiring link verification in addition to password login.