ypt-js

An unofficial, fully typed Node.js/TypeScript client for the Yeolpumta (YPT) study app, dual-token auth, Zod-validated responses, live study telemetry, and group moderation.

TypeScriptNode.jsBunZodREST APINPM LibraryVitePress

An unofficial, reverse-engineered client library for the Yeolpumta (YPT) study app. It gives you typed sessions, live study telemetry, and group moderation without having to deal with the obfuscated upstream wire format yourself.

This project is not affiliated with, endorsed by, or supported by YPT / TGCLab. Use it responsibly, keep request volume low, and never handle credentials or data you do not own.

Features

  • Dual-token authentication: accessToken and refreshToken management with automatic 401 rotation.
  • Social sign-up and OAuth: Kakao, Naver, Google, Apple, and Facebook flows.
  • Downstream auth: Google Firebase Custom Tokens and device push token registration.
  • Runtime schema validation: Zod checks inputs before I/O and leniently validates responses so upstream drift is visible.
  • Live study calculations: real-time study time based on ongoing sessions, attendance matrices, and leaderboards.
  • Group moderation: warnings, kicks, blacklists, applicant review, nudges, chat, and notices.
  • Cross-group merge: deduplicates the same member across groups and keeps the maximum study time.
  • Runtime ready: native fetch, Node.js 18+ and Bun, ESM and CommonJS builds, full TypeScript declarations.

Installation

bun add ypt-js
# or
npm install ypt-js

The package is published on npm as ypt-js.

Quick Start

import { YptJs } from "ypt-js";

const ypt = new YptJs({
  credentials: {
    email: process.env.YPT_EMAIL!,
    password: process.env.YPT_PASSWORD!,
  },
});

const groups = await ypt.groups.listJoined();
const members = await ypt.groups.getMembers(groups[0].id);

for (const member of members) {
  console.log(member.nickname, member.liveStudyTime);
}

Sessions can also be restored from a persisted refresh token:

const refreshToken = await loadSavedRefreshToken();

const ypt = new YptJs({
  refreshToken,
  onTokenChange: (accessToken, nextRefreshToken) => {
    saveTokens({ accessToken, refreshToken: nextRefreshToken });
  },
});

Documentation

Disclaimer

This is an unofficial client. Use it in accordance with YPT's terms of service, keep request volume reasonable, and protect user privacy.

License

MIT LICENSE.