JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q62952F
  • License MIT

JavaScript/TypeScript library for SpamPatrol.io

Package Exports

  • spampatrol

Readme

SpamPatrol JavaScript/TypeScript Client Package

Add intent-based spam filtering to forms without re-implementing detection logic. SpamPatrol analyzes submissions like a human would—understanding real intent rather than just relying on IP/domain heuristics—so it can flag botnets, rouge humans, or suspect messages quickly. Fast responses keep your workflows moving, you can route low-score content to spam folders for review. Includes privacy-friendly hashing to avoid third-party tracking.

Installation

yarn add spampatrol

You can use it without an API key for low-volume traffic, and when you exceed that threshold you can create a key at https://spampatrol.io to unlock higher quota.

Distribution

The package ships both CommonJS and ESM bundles (dist/index.cjs and dist/index.mjs) plus TypeScript declarations, so you can import it from legacy Node stacks or modern tooling.

Usage (TypeScript)

import SpamPatrol from 'spampatrol';

const client = new SpamPatrol({
  apiKey: process.env.SPAMPATROL_API_KEY,
});

const analysis = await client.analyze({
  content: 'I would like to buy your services!',
  expectedCountries: ['US'],
});

console.log('score', analysis.result.score);
console.log('spam?', analysis.result.solicitation);
import { analyze } from 'spampatrol';

const analysis = await analyze({
  content: 'Sign me up for your newsletter.',
  expectedLanguages: ['en'],
  apiKey: process.env.SPAMPATROL_API_KEY,
});

console.log('score', analysis.result.score);