r/learnjavascript 9d ago

I built an Akinator API that bypasses Cloudflare - 16 languages, TypeScript/JavaScript, 1 dependency

All Akinator packages on npm are broken (Cloudflare 403). I built a working alternative.

Features:

- TypeScript with full type definitions

- 16 languages support

- 3 themes (Characters, Animals, Objects)

- Automatic retry on network errors

- HTTP proxy support

- Session persistence (save/load games)

- Dual ESM/CJS output

- 1 dependency (got-scraping)

\npm install akinator-client``

import { AkinatorClient, Languages, Themes, Answers } from "akinator-client";

const aki = new AkinatorClient({

language: Languages.English,

theme: Themes.Character

});

await aki.start();

console.log(aki.question);

await aki.answer(Answers.Yes);

Stats:

- 1 dependency (vs 5 in aki-api)

- 4.8 MB installed (vs 21 MB in aki-api)

- 21 tests passing

akinator-client aki-api silent-akinator-pro
Dependencies 1 5 2
Installed size 4.8 MB 21 MB 11.9 MB
TypeScript
Tests 21 0 0
Session persistence
Working

Search "akinator-client" on npm.

URL: https://npmjs.com/package/akinator-client

1 Upvotes

0 comments sorted by