Quick Start

Get WordAuth running in minutes. Pick your language below.

Install the official npm package:

npm install wordauth

Generate and validate a word pair:

import { WordAuth } from "wordauth"; const wordauth = new WordAuth("sk_live_your_api_key"); // Generate a word pair const { otp_id, code } = await wordauth.generate(); console.log(`Code: ${code}`); // e.g. "happening holiday" // -- Deliver via email instead -- // const { otp_id, code } = await wordauth.generateWithEmail("[email protected]"); // -- Deliver via SMS instead -- // const { otp_id, code } = await wordauth.generateWithSMS("+15550001234"); // Validate user input const result = await wordauth.validate({ otp_id, code: userInput }); if (result.valid) { console.log("Verified!"); }