Skip to content

A version of the Spamwat.ch JS API that runs on CloudFlare Workers

License

Notifications You must be signed in to change notification settings

Crashdoom/spamwatch-js-fetch

Repository files navigation

SpamWatch API JavaScript Wrapper (fetch alternate)

Alternative version of the official SpamWatch JS API that uses the Fetch API instead of axios for better compatibility with non-NodeJS clients.

This library has TypeScript types included, so you do not need to install types separately.

API Documentation

For documentation on the API, visit the SpamWatch documentation at https://docs.spamwat.ch/.

Example Usage

async / await

(async () => {
	const client = new Client('APITOKEN');
	console.log(await client.getBan(12345));
})();

Promise

const client = new Client('APITOKEN');
client.getBan(12345).then(ban => console.log).catch(console.err);