You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quantum-safe encryption, digital signatures, and credential vault management for Node.js.
The official QuantaSeal Node.js SDK wraps the QuantaSeal REST API with full TypeScript types, automatic retries with exponential backoff, and a clean async interface for quantum-safe cryptography.
constcreds=awaitqs.vault.unseal(entryId);console.log(creds.plaintext);// { access_key: "AKIA...", ... }console.log(creds.lastAccessedAt);// ISO 8601
Vault - Rotate Keys
constrotated=awaitqs.vault.rotate(entryId);console.log(rotated.newEntryId);// fresh entry with new keysconsole.log(rotated.oldEntryId);// old entry (now inactive)
Vault - List Entries
constentries=awaitqs.vault.list();// or include soft-deleted:constall=awaitqs.vault.list({includeInactive: true});for(constentryofentries){console.log(entry.name,entry.credentialType,entry.isActive);}
Vault - Delete
awaitqs.vault.delete(entryId);// soft-delete
Configuration
Environment Variables
Variable
Description
Default
QUANTASHIELD_API_KEY
API key (qs_live_... or qs_test_...)
-
QUANTASHIELD_BASE_URL
API base URL
https://api.quantaseal.io
Constructor Options
constqs=newQuantaSeal({apiKey: "qs_test_...",// or set QUANTASHIELD_API_KEYbaseUrl: "https://...",// or set QUANTASHIELD_BASE_URLtimeout: 30_000,// request timeout in ms (default 30s)maxRetries: 3,// retry transient failures (default 3)headers: {// extra headers on every request"X-Custom-Header": "value",},});
Error Handling
All errors extend QuantaSealError with structured properties:
import{QuantaSealError,AuthenticationError,ValidationError,NotFoundError,VaultError,RateLimitError,ServerError,ConnectionError,TimeoutError,}from"@quantaseal/sdk";try{awaitqs.encrypt(data);}catch(err){if(errinstanceofRateLimitError){// err.retryAfter - seconds to waitawaitsleep(err.retryAfter!*1000);// retry...}elseif(errinstanceofAuthenticationError){// err.statusCode - 401 or 403console.error("Auth failed:",err.message);}elseif(errinstanceofQuantaSealError){// Base class - catches all SDK errorsconsole.error(err.statusCode,err.errorCode,err.requestId);}}
Exception Hierarchy
Exception
HTTP Status
Description
QuantaSealError
Any
Base class for all SDK errors
AuthenticationError
401, 403
Invalid/expired API key or insufficient permissions
ValidationError
400, 422
Invalid request (bad base64, missing fields)
NotFoundError
404
Resource not found (invalid vault entry ID)
VaultError
410
Vault entry expired (TTL exceeded)
RateLimitError
429
Rate limit exceeded (check retryAfter)
ServerError
5xx
Transient server error (auto-retried)
ConnectionError
-
Network connectivity failure
TimeoutError
-
Request timed out
Algorithms
Operation
Algorithm
Standard
Key Encapsulation
ML-KEM-768
NIST FIPS 203
Symmetric Encryption
AES-256-GCM
NIST SP 800-38D
Digital Signature
ML-DSA-65
NIST FIPS 204
HMAC
HMAC-SHA-512
RFC 2104
Requirements
Node.js >= 18.0.0
TypeScript >= 5.0 (optional, for type checking)
API Reference
QuantaSeal
Method
Returns
Description
encrypt(plaintext, options?)
Promise<EncryptResult>
Encrypt data with ML-KEM-768
decrypt(envelope, options?)
Promise<DecryptResult>
Decrypt a HybridCryptoEnvelope
sign(data, options?)
Promise<SignResult>
Sign data with ML-DSA-65
verify(params)
Promise<VerifyResult>
Verify ML-DSA-65 + HMAC signature
QuantaSeal.vault
Method
Returns
Description
seal(params)
Promise<string>
Encrypt + store credential (returns UUID)
unseal(entryId)
Promise<VaultUnsealResult>
Decrypt + retrieve credential
rotate(entryId)
Promise<VaultRotateResult>
Re-encrypt with fresh keys
list(options?)
Promise<VaultEntry[]>
List entry metadata (no plaintext)
delete(entryId)
Promise<void>
Soft-delete entry
Development
# Install dependencies
npm install
# Run tests
npm test# Run tests in watch mode
npm run test:watch
# Type check
npm run typecheck
# Build
npm run build