Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ecies/js-post-quantum/llms.txt

Use this file to discover all available pages before exploring further.

@ecies/post-quantum is published to the npm registry and works across Node.js, Bun, Deno, modern browsers, and React Native. This page covers how to install the package with each supported package manager, environment-specific configuration requirements, and how to verify the installation is working.

Package managers

Install the package with your preferred package manager:
npm install @ecies/post-quantum

Runtime requirements

RuntimeMinimum version
Node.js≥ 16
Bun≥ 1
Deno≥ 2
Modern browsers and React Native are also supported — see the platform notes below.

TypeScript

TypeScript types are bundled with the package. No separate @types/ package is needed. The type declarations are exported from dist/index.d.ts and are automatically resolved by the TypeScript compiler.
// Types are inferred automatically — no extra steps needed.
import { encrypt, decrypt, Config, DEFAULT_CONFIG } from "@ecies/post-quantum";
Ensure your tsconfig.json targets at least ES2020 and has moduleResolution set to "node16", "nodenext", or "bundler" to correctly resolve the package’s exports map.

Platform-specific notes

Deno

The package supports Deno ≥ 2. Depending on your Deno version, you may need an extra flag to resolve the deno export condition:
  • Deno ≥ 2.4.0 — run with --conditions deno:
    deno run --conditions deno your_script.ts
    
  • Deno ≥ 2.3.6 and < 2.4.0 — run with --unstable-node-conditions deno:
    deno run --unstable-node-conditions deno your_script.ts
    

React Native

React Native does not expose the Web Crypto API by default. You must polyfill crypto.getRandomValues before importing @ecies/post-quantum. Install react-native-get-random-values and import it at the top of your entry file:
// Import before any other crypto-dependent module
import "react-native-get-random-values";
import { encrypt, decrypt, DEFAULT_CONFIG } from "@ecies/post-quantum";

Browser

The library is browser-friendly out of the box and relies on the Web Crypto API, which is available in all modern browsers. No additional configuration is required. Use a bundler such as Vite, webpack, or esbuild to bundle the package for browser delivery.

Verifying the installation

After installing, confirm everything resolves correctly by running the following snippet:
import { DEFAULT_CONFIG } from "@ecies/post-quantum";

// Prints the active asymmetric and symmetric algorithm names
console.log(DEFAULT_CONFIG.asymmetricAlgorithm); // "ml-kem-768"
console.log(DEFAULT_CONFIG.symmetricAlgorithm);  // "aes-256-gcm"
If the import resolves without error and the values are printed, the package is installed correctly and ready to use.

Build docs developers (and LLMs) love