Two npm packages for integrating phonetic analysis into your own tools. Zero dependencies. MIT licensed.
@phonopair/sdkThe official JavaScript client for the PhonoPair API. Analyse word combinations and retrieve phoneme data with a clean, promise-based interface.
Installnpm install @phonopair/sdk
import PhonoPairClient from '@phonopair/sdk';
const client = new PhonoPairClient({
baseUrl: 'https://www.phonopair.com',
token: 'YOUR_API_KEY', // optional — required for rate-limited endpoints
});
const result = await client.analyze(['velvet', 'thunder']);
console.log(result.score); // 74
console.log(result.interpretation.label); // 'Strong'
console.log(result.pillars.phonetic.score); // 68Normalises all three API response shapes to a consistent result object
Supports 1–5 words: single word, pair, and multi-word analysis
Handles authentication, timeouts, and error wrapping
@phonopair/phonetic-pairPure phonetic compatibility scoring for CMU Arpabet phoneme arrays. Run Pillar 1 analysis locally — no API call required.
Installnpm install @phonopair/phonetic-pair
import { score, normalise } from '@phonopair/phonetic-pair';
import { interpretScore } from '@phonopair/phonetic-pair/scoring';
// CMU phonemes (stress digits stripped automatically)
const result = score(
['V', 'EH1', 'L', 'V', 'AH0', 'T'],
['TH', 'AH1', 'N', 'D', 'ER0']
);
console.log(result.overall); // 53
console.log(result.components); // { assonance, consonance, rhythm, ... }
console.log(interpretScore(result.overall).label); // 'Moderate'Zero dependencies — works in Node.js 16+, edge runtimes, and the browser
Strips CMU stress digits automatically
Individual scorers exported for custom pipelines
Building something with these packages? We'd like to hear about it.
Get in touch →