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 an API 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://verifywall.com';
const VERIFYWALL_KEY = process.env.VERIFYWALL_API_KEY;

export async function check(subject) {
  const url = new URL(`${VERIFYWALL_URL}/v1/check`);
  url.searchParams.set('q', subject);

  const response = await fetch(url, {
    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 { check } from '../verifywall.js';

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

  const result = await check(email);

  if (result.risk_level === 'high') {
    return res.status(422).json({
      error: 'Registration blocked. Please try again.',
    });
  }

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

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

Test the integration

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

curl https://verifywall.com/api/v1/[email protected] \
  -H "Authorization: Bearer $VERIFYWALL_API_KEY"

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 API 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 check function for full type safety.

Ready to integrate?

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