Skip to main content
Use the Hypersender OTP service from Node.js to send verification codes over WhatsApp or SMS, validate the codes your users enter, and generate passwordless WhatsApp links.

What you can do

  • Request OTP codes: Generate a one-time code and send it from a WhatsApp or SMS instance.
  • Validate codes: Check user-entered codes against the active OTP.
  • Generate OTP links (WhatsApp only): Create WhatsApp links that complete verification without typing. SMS instances can’t generate links.

Prerequisites

  • Node.js app with the hypersender-node package installed (Installation).
  • Hypersender API token and Instance UUID from the dashboard, set as HYPERSENDER_OTP_API_KEY and HYPERSENDER_OTP_INSTANCE_ID.
  • For SMS, an SMS instance with the Hypersender SMS app running on the linked Android phone. See SMS quick start.

Base URL and auth

The SDK adds the instance UUID to the URL and the token to the header for you.

Quick start (request and validate)

Both methods return the parsed, typed response body, with the OTP details under data. Any 4XX or 5XX response throws an error that extends HypersenderError; a wrong, used, or expired code throws with statusCode 422.

Send the code over SMS

With an SMS instance, pass the phone number in international format as chatId. Spaces, dashes, dots, and parentheses are removed, and 00 at the start is read as +. WhatsApp chat IDs are rejected for SMS.
The user receives a short plain-text SMS, such as:
The wording rotates between six short versions, so carriers are less likely to drop it. Validate it with the same phone number. If you want your own message text, send the code yourself with the SMS API. See the SMS OTP guide.
Keep tokens and OTP codes out of logs. Use HTTPS for all calls.

Next steps

Last modified on November 23, 2026