Socket
Socket
Sign inDemoInstall

express-turnstile

Package Overview
Dependencies
67
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-turnstile

Express middleware for CloudFlare Turnstile Captcha


Version published
Maintainers
1
Weekly downloads
3
decreased by-50%

Weekly downloads

Readme

Source

express-turnstile

Validate your CloudFlare Turnstile token using a Express middleware.

Usage

yarn add express-turnstile

Middleware is executed by calling turnstile.validate(siteSecret).

const express = require("express");
const { turnstile } = require("express-turnstile");

const app = express();

app.post(
  "/verify",
  turnstile.validate(process.env.TURNSTILE_SECRET),
  (req, res) => {
    res.json({ message: "verified!" });
  }
);

app.listen(3000, () => {
  console.log("Server started on port 3000");
});

Or as module

import express from "express";
import { turnstile } from "express-turnstile";

const app = express();

app.post(
  "/verify",
  turnstile.validate(process.env.TURNSTILE_SECRET),
  (req, res) => {
    res.json({ message: "verified!" });
  }
);

app.listen(3000, () => {
  console.log("Server started on port 3000");
});

Keywords

FAQs

Last updated on 18 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc