nomyo-js/doc
alpha nerd 111335d7ff
fix: correct package entry points and publish contents
Five packaging defects, all pre-existing:

1. dist/esm/index.js held ESM syntax while the package is not
   "type": "module", so Node classified it as CommonJS. It failed
   outright on Node 18 ("Unexpected token 'export'") and only worked on
   Node >= 22 because Node re-parses after guessing the module type,
   paying that cost on every import. Bundles now carry explicit
   extensions: .mjs for ES output, .cjs/.js for CommonJS. The browser
   build gained a real CommonJS output too — the exports map previously
   pointed the browser "require" condition at an ES module.
   The exports map now also leads with "types" and ends with a "default"
   fallback for resolvers matching neither "node" nor "browser".

2. files: ["native"] published the local build directory: a 94.6 kB
   Linux-x64 .node binary, a 148 kB object file and generated Makefiles.
   node-gyp-build checks build/Release before prebuilds, so every
   consumer on every platform would have found this machine's binary,
   skipped compiling, and failed to load it. It fails safe (native/
   index.js catches and returns null), but the addon could never work
   for anyone else. Narrowed to the four source files.

3. binding.gyp resolves node-addon-api at build time, but nothing
   declared it: it was a devDependency of the root, absent from
   native/package.json. The build only succeeded here because a dev
   install populates the root node_modules. Declared as a dependency of
   the native package, where it is actually needed.

4. No clean step, so stale output shipped — the tarball carried both
   dist/types/core/** and a dist/types/src/** tree left over from before
   rootDir was set. build now runs clean first.

5. test:browser ran `karma start` with no karma.conf.js anywhere in the
   repo, and tests/browser is an empty directory. Removed the script and
   the karma devDependency rather than leave a script that cannot run.

Verified: CommonJS require and ESM import both resolve on Node 18.19.1
and 24.18.0; TypeScript resolves types under both bundler and node16;
npm pack now produces 35 files / 103.8 kB with no build artefacts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 12:39:09 +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: correct package entry points and publish contents 2026-07-19 12:39:09 +02:00
getting-started.md fix: correct package entry points and publish contents 2026-07-19 12:39:09 +02:00
installation.md fix: correct package entry points and publish contents 2026-07-19 12:39:09 +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.