nomyo-js/doc
alpha nerd eafab3d9ac
All checks were successful
NYX Security Scan / nyx-scan (pull_request) Successful in 5m43s
feat: align timeout, error types and docs with the Python SDK
Completes the parity work (step 4).

Request timeout now defaults to 900 s, matching Python, instead of 60 s.
Encrypted inference cannot stream, so an entire completion arrives in one
response; a long generation on a busy backend legitimately takes minutes
and was timing out here while succeeding in the Python client.

Error types now distinguish malformed data from integrity failures.
Python raises ValueError for a bad package, a non-200 or unparseable
/pki/public_key, and plaintext that will not parse, reserving
SecurityError for crypto failures. This port wrapped nearly all of it in
SecurityError — so a server sending malformed JSON was reported as an
authentication failure, pointing debugging in exactly the wrong
direction. Malformed data is now a plain Error (the JS equivalent of
ValueError), carried past the deliberately opaque catch-all by a symbol
marker rather than a new exported class. Genuine crypto failures still
report a single vague message so they cannot serve as a decryption
oracle.

Also adds the missing guard Python has: decrypting without a private key
now says so, instead of failing later and being reported as an integrity
failure.

doc/attestation.md ports the Python attestation guide to the JS API, and
documents the two deliberate divergences: no verify_ssl escape hatch, and
jose injection instead of a runtime dynamic import.

Version 0.1.0 -> 0.3.0 to match the Python client's feature level, now
that the two are at parity.

Not ported: Python's warning when secure_memory=True but the SecureMemory
module is unavailable. There is no JS equivalent — zeroing is always
available, and the weaker case (mlock unavailable) is already reported
honestly by getProtectionInfo().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 12:17:52 +02:00
..
api-reference.md feat: align timeout, error types and docs with the Python SDK 2026-07-19 12:17:52 +02:00
attestation.md feat: align timeout, error types and docs with the Python SDK 2026-07-19 12:17:52 +02:00
examples.md fix: base_url 2026-04-16 16:44:26 +02:00
getting-started.md fix: base_url 2026-04-16 16:44:26 +02:00
installation.md fix: base_url 2026-04-16 16:44:26 +02:00
models.md fix: base_url 2026-04-16 16:44:26 +02:00
rate-limits.md fix: base_url 2026-04-16 16:44:26 +02:00
README.md feat: align timeout, error types and docs with the Python SDK 2026-07-19 12:17:52 +02:00
security-guide.md feat!: make RSA keys ephemeral by default 2026-07-19 11:19:03 +02:00
SECURITY.md doc: fixing SECURITY.md in correct folder 2026-04-17 18:29:14 +02:00
troubleshooting.md feat: align timeout, error types and docs with the Python SDK 2026-07-19 12:17:52 +02:00

NOMYO.js Documentation

Comprehensive documentation for the NOMYO secure JavaScript/TypeScript chat client — a drop-in replacement for OpenAI's ChatCompletion API with end-to-end encryption.

To use this library you need an active subscription on NOMYO Inference.

Quick Start

import { SecureChatCompletion } from 'nomyo-js';

const client = new SecureChatCompletion({ apiKey: process.env.NOMYO_API_KEY });

const response = await client.create({
  model: 'Qwen/Qwen3-0.6B',
  messages: [{ role: 'user', content: 'Hello!' }],
  security_tier: 'standard',
});

console.log(response.choices[0].message.content);

Documentation

  1. Installation — npm, CDN, and native addon setup
  2. Getting Started — first request, auth, security tiers, error handling
  3. API Reference — complete constructor options, methods, and types
  4. Models — available models and selection guidance
  5. Security Guide — encryption architecture, best practices, and compliance
  6. Attestation — SGX enclave verification for high/maximum tiers
  7. Rate Limits — request limits, burst behaviour, and retry strategy
  8. Examples — real-world scenarios, browser usage, and advanced patterns
  9. Troubleshooting — common errors and their fixes

Key Features

  • End-to-end encryption — AES-256-GCM + RSA-OAEP-4096. No plaintext ever leaves your process.
  • OpenAI-compatible APIcreate() / acreate() accept the same parameters as the OpenAI SDK.
  • Browser + Node.js — single package, separate entry points for each runtime.
  • Ephemeral key management — a fresh key pair is generated in memory on first use and never written to disk unless you set keyDir (Node.js).
  • SGX attestation — optionally prove the server key was generated inside a genuine enclave before sending plaintext (details).
  • Automatic key rotation — RSA keys rotate on a configurable interval (default 24 h) to limit fingerprint lifetime.
  • Security tiers — per-request routing to standard, high, or maximum isolation hardware.
  • Retry with exponential backoff — automatic retries on 429 / 5xx / network errors (configurable).
  • Resource lifecycledispose() immediately zeros in-memory key material and stops the rotation timer.

Technical Security Docs

For cryptographic architecture, threat model, and implementation status see SECURITY.md.