JsVM.MMO69.Com
Sign In Register
API Reference

Documentation

Everything you need to call the JsVM.MMO69.Com protection API from Node.js or CI.

01

Quick start

1

Create a free account at /register — no credit card needed.

2

Open the API KEY page inside /client/ and create a key (Pro plan or higher).

3

POST your JavaScript to /api/vm with the key — get protected code back.

02

NodeJS SDK — @mmo69/vmcode

The official SDK wraps the two-step task API for you — submit, poll, gzip uploads, typed errors. Zero dependencies, Node 18+.

bash
npm i @mmo69/vmcode
node
// protect.js — one call: submit + auto-poll until done
import { VmCode } from '@mmo69/vmcode';
import fs from 'node:fs';

const vm = new VmCode({ apiKey: 'tnvm_YOUR_KEY' }); // Pro+ key — create at /client/apikeys.html

const out = await vm.protect(
  fs.readFileSync('src/app.js', 'utf8'),
  { preset: 'medium', target: 'node' },
);
fs.writeFileSync('app.protected.js', out.result);
console.log(`done in ${out.elapsed}ms — quota ${out.usage?.bytes}/${out.usage?.quotaMB}MB`);

Manual control: vm.submit(code, options) → {taskId}, then vm.poll(taskId) whenever you are ready (the result can be fetched once). Every failure throws VmError with err.code matching the table below — a protect() timeout message includes the taskId so you can resume polling.

Full reference with the complete preset/options tables: npmjs.com/package/@mmo69/vmcode · github.com/nttrung9x/vmcode (README in English & Vietnamese).

03

Authentication

Two ways to authenticate: the browser session cookie (sent automatically by the web app under /client/), or an API key for scripts and CI.

API keys look like tnvm_… and require the Pro plan or higher. Pass the key in one of these headers:

http
# Send the key in one of these headers
Authorization: Bearer tnvm_YOUR_KEY
X-Api-Key: tnvm_YOUR_KEY
04

POST/api/vm

Compiling runs as a background task (like captcha-solver APIs). Request body is JSON. Fields:

codestring, required — the JavaScript source to protect (decompressed size within your plan limit; 128 KB for anonymous).
options.preset'low' | 'medium' | 'max' — protection level. Anonymous requests may use 'low' and 'medium' only.
options.*Pro+ accounts: boolean toggles from the Options tab + targetMode ('root'|'comment') + target ('browser'|'node'). Free & anonymous: preset defaults only.
tokenstring — anonymous only: issued by GET /api/meta and handled automatically by the web demo (IP-locked, 15 min). External calls need a Pro+ API key.

Step 1 — POST /api/vm returns {taskId} immediately. Step 2 — poll POST /api/vm/result with {taskId} (add token for anonymous): status "pending"/"running" while queued, then {status:'done', result, elapsed, usage:{bytes, quotaMB, requests, month}}. The result can be fetched once; unfetched tasks expire within 2 hours.

Tip: large bodies may be sent with Content-Encoding: gzip — and every response is gzip-compressed automatically.

05

Examples

node
// Protect a function with your API key (Node 18+)
const base = 'https://JsVM.MMO69.Com';
const sub = await (await fetch(base + '/api/vm', {
  method: 'POST',
  headers: { Authorization: 'Bearer tnvm_YOUR_KEY', 'content-type': 'application/json' },
  body: JSON.stringify({ code: 'function greet(name){ return "Hello, " + name + "!"; }\nconsole.log(greet("World"));', options: { preset: 'medium' } }),
})).json(); // {taskId} — the code is queued
let data;
for (;;) {
  await new Promise((r) => setTimeout(r, 1000));
  data = await (await fetch(base + '/api/vm/result', {
    method: 'POST',
    headers: { Authorization: 'Bearer tnvm_YOUR_KEY', 'content-type': 'application/json' },
    body: JSON.stringify({ taskId: sub.taskId }),
  })).json();
  if (!['pending', 'running'].includes(data.status)) break; // done / error / gone
}
if (data.result) console.log(data.result); // save it as hello.protected.js and run: prints "Hello, World!"

Full options — every engine toggle, generated live from /api/meta (Pro+)

node

        
http
# 429 — monthly quota exceeded
HTTP/1.1 429 Too Many Requests
{"error":"Monthly quota exceeded. Upgrade your plan to continue.","code":"quota"}
06

Error codes

07

Rate limits & plans

Who can call /api/vm — external scripts and CI: Pro+ accounts with an API key (tnvm_…) only. Anonymous & Free plans work through the website (landing demo / web app), not from outside.