JavaScript · Client-Side · Content Moderation

Parry
API

A drop-in toxicity detector for game chat. One JavaScript file, zero backend: call analyze() and get a sentiment score back instantly, in-process.

Live on VercelSolo Developer2024
sentiment-analyzer.js · live

Enter text above to see analysis

Project Details

Smaller game studios often lack the resources to run or maintain a moderation backend. Parry API skips the backend entirely: drop one JavaScript file into a project, instantiate an analyzer, and call analyze() to get a compound sentiment score back synchronously, no server, no network round-trip. Developers set their own thresholds to tune how strict or lenient the filter is for their specific community.

NOTEExplicit slurs are omitted from the public lexicon , ethical by design. General negative patterns still catch most toxic content effectively.
Fast Analysis
Synchronous, in-process scoring with no network round-trips for the core classifier.
Gaming Aware
Understands gg, wp, noob, glhf, rekt, ez: hundreds of gaming terms scored.
Text Normalization
"h@t3" and "hate" score identically. Obfuscation is detected automatically.
Customizable
Tune thresholds, inject custom words, and extend the lexicon to your domain.
Privacy First
No third-party services for core analysis. Designed for data-sensitive environments.
Zero Dependencies
One file, zero external dependencies. Drop into any existing stack.
01
Page includes sentiment-analyzer.js and instantiates a SentimentAnalyzer
02
Calling code passes chat text directly to analyze(), no request needed
03
Text normalization: l33tspeak and obfuscation mapped to base words
04
VADER lexicon scores each token; negation inverts neighboring scores
05
Compound score normalized to −1 → +1 range and returned synchronously
06
classify() compares the score against developer-set thresholds
Client-side over a hosted API: a moderation check that has to round-trip to a server adds latency exactly when it matters most, mid-match, mid-conversation. Running VADER scoring in-process means zero network cost, no cold starts, and no backend to host or pay for.
Custom gaming lexicon: standard VADER misses most gaming slang ("noob", "ez", "int", "leaver"). Building a domain-specific extension was the only way to get meaningful signal from actual game chat.
Zero dependencies, one file: the whole analyzer ships as a single .js file with no build step and nothing to npm install, so it drops into an existing project as easily as a script tag.
Ethical lexicon design: explicit slurs are intentionally excluded from the public lexicon, since it ships client-side and is fully readable by anyone. Most toxic patterns are still caught through negative scoring of adjacent language, without exposing harmful terms directly.

Keeping the lexicon effective without an explicit-slur list required deliberate design: the analyzer leans on negative scoring of surrounding language and pattern-based obfuscation detection rather than a blocklist, since the whole file is publicly readable client-side and can't rely on hiding anything.

Standard sentiment models miss a lot of gaming slang. Building the custom VADER lexicon meant mapping community-specific language to meaningful sentiment signals, which required iterative testing against real chat logs.

  • TypeScript type definitions for the analyzer class
  • Optional Web Worker offloading for very high-volume chat streams
  • Expanded gaming lexicon covering more game genres and community vocabularies