Skip to main content
Create a passwordless flow: generate a WhatsApp link that pre-fills a message with a unique code. When the user taps Send in WhatsApp, you get the verification event via callbacks. Use the Laravel SDK method to keep things concise.

Parameters

FieldTypeRequiredDescription
expiresintnoTTL in seconds (default 1800).
namestringnoYour app name displayed in messages.
message.promptstringyesText pre-filled in the WhatsApp link.
message.successstringyesReply when verification succeeds. Use {link} placeholder.
message.failedstringyesReply when verification fails.
message.expiredstringyesReply when the link expired.
callback.successstringnoWebhook URL for successful verification.
callback.failedstringnoWebhook URL for failed verification.
use Hypersender\Hypersender;

$response = Hypersender::otp()->generateLink([
  'expires' => 900,
  'name' => 'YourApp',
  'message' => [
    'prompt' => 'Give me link to login at YourApp',
    'success' => 'Welcome! Here is your login link: {link}',
    'failed' => 'Login failed. Please try again.',
    'expired' => 'This link expired. Request a new one.',
  ],
  'callback' => [
    'success' => 'https://yourdomain.com/api/otp/success',
    'failed' => 'https://yourdomain.com/api/otp/failed',
  ],
]);

$whatsappLink = $response['whatsapp_link'] ?? null;
Send whatsappLink via email, SMS, or in-app notification. When the user clicks it, WhatsApp opens with the prompt + code. Handle callbacks to finalize the login.
Secure your callback endpoints (HTTPS + auth) and invalidate links after use.
Send OTP Link Code