@emoji-captcha/server
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Emoji Captcha

Next gen captcha generator, which uses emojis to identify humans

emoji captcha demo

Server Installation

Install emoji-captcha with npm

  npm install @emoji-captcha/server

Install emoji-captcha with yarn

  yarn add @emoji-captcha/server

Server Usage/Examples

Generate Emoji

Somewhere in your routes

import { generateEmoji, verifyEmoji } from "@emoji-captcha/server";

const emojiRes = await generateEmoji({
  secret: env.top_secret,
  emojiCount: 5,
  encoding: "svg-xml",
});

//now send emojis to client form

Emoji properties

{
  answer: "cipher containing correct index",
  emojis: [
    "svg 1",
    "svg 2",
    "svg 3",
    "svg 4",
    "svg 5",
  ],
  question: "man bowing"
}

Verifying response

const isCorrect = await verifyEmoji({
  secret: env.top_secret,
  answerHash: "cipher containing correct index",
  selectedIdx: 3, // emoji index which user picked
});

Readme

Keywords

none

Package Sidebar

Install

npm i @emoji-captcha/server

Weekly Downloads

1

Version

2.0.2

License

MIT

Unpacked Size

5.93 MB

Total Files

215

Last publish

Collaborators

  • shivamjoker