Node.js Integration

Integrate VerifyWall with Node.js in minutes

Add fraud detection to your Express, Fastify, or any Node.js application with a lightweight fetch-based client.

1

Set up your environment

Node.js 18+ includes a built-in fetch API. Store your API key as an environment variable.

VERIFYWALL_API_KEY=your-api-key-here
2

Create a verification client

Create a reusable module that wraps the VerifyWall API. This works with Express, Fastify, Koa, or any Node.js framework.

const VERIFYWALL_URL = process.env.VERIFYWALL_URL || 'https://api.verifywall.com';
const VERIFYWALL_KEY = process.env.VERIFYWALL_API_KEY;

export async function verify({ email, ip }) {
  const response = await fetch(`${VERIFYWALL_URL}/v1/verify`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${VERIFYWALL_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ email, ip }),
  });

  if (!response.ok) {
    throw new Error(`VerifyWall API error: ${response.status}`);
  }

  const json = await response.json();
  return json.data.attributes;
}

export async function check(subject) {
  const response = await fetch(
    `${VERIFYWALL_URL}/v1/check?` + new URLSearchParams({ q: subject }),
    {
      headers: {
        'Authorization': `Bearer ${VERIFYWALL_KEY}`,
      },
    }
  );

  if (!response.ok) {
    throw new Error(`VerifyWall API error: ${response.status}`);
  }

  const json = await response.json();
  return json.data.attributes;
}
3

Add to your registration route

Call VerifyWall in your Express registration handler to score each signup before creating the user.

import { verify } from '../verifywall.js';

app.post('/register', async (req, res) => {
  const { email, password, name } = req.body;

  const risk = await verify({
    email,
    ip: req.ip,
  });

  if (risk.risk_level === 'high') {
    return res.status(422).json({
      error: 'We could not verify your identity. Please try again.',
    });
  }

  const user = await User.create({
    name,
    email,
    password: await hash(password),
    riskScore: risk.risk_score,
  });

  req.session.userId = user.id;
  res.redirect('/dashboard');
});
4

Verify the integration

Test with a known disposable email to confirm everything is working.

curl -X POST https://api.verifywall.com/v1/verify \
  -H "Authorization: Bearer $VERIFYWALL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

Frequently asked questions

Does VerifyWall work with Express, Fastify, and Koa?

Yes. VerifyWall is a REST API called via fetch, so it works with any Node.js framework. The examples use Express, but the verification client module works identically with Fastify, Koa, Hapi, or vanilla Node.js HTTP.

Is there an official Node.js SDK?

Not yet. The API is simple enough that a fetch wrapper is all you need. The verification client module shown above is typically fewer than 30 lines of code.

Can I use this with TypeScript?

Absolutely. The fetch-based client works with TypeScript out of the box. Add type annotations to the verify and check functions for full type safety.

Ready to integrate?

Get your API key and start protecting your Node.js application in minutes.